Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Issue

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I have an input type=text and a input type=image side-by-side and they will not align vertically... the image sits a little higher than the textfield... any ideas why or how to correct that?



[conehead]
 
if the image is a gif, is there a transparent area? you may have to adjust position to accomodate it.
or...
are the inputs in a table cell? if so, you can align them with td valign="top" (or "center" or "bottom")
 
I've tried adjusting the image - adding size to it - but the textfield moves along with it.... they are in the same cell and I have tried valinging... no dice...

[conehead]
 
It could be a margin or padding problem. You could create a style for inputs and give them 0 padding and 0 margin.
Code:
input{
  margin: 0px;
  padding: 0px;
}

Kevin
A+, Network+, MCP
 
Do you have an example or can you post a link to the page?

Kevin
A+, Network+, MCP
 
just:
<form action=&quot;searh.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;kword&quot;>
<input type=&quot;image&quot; src=&quot;images/search.gif&quot; border=&quot;0&quot; alt=&quot;Search&quot;>
</form>


just a form....

[conehead]
 
I have &quot;fixed&quot; it by putting them in two different cells... still would love to know how to properly align them in the same cell...

[conehead]
 
The only way I could get it to work was specify a style of vertical-align: bottom for both inputs:
Code:
<form action=&quot;searh.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;kword&quot; style=&quot;vertical-align: bottom&quot;>
<input type=&quot;image&quot; src=&quot;images/search.gif&quot; alt=&quot;Search&quot; style=&quot;vertical-align: bottom; border: 0px;&quot;>
</form>

Kevin
A+, Network+, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top