Jump to content

Image as button (Vertical align)


ze1d

Recommended Posts

Hi all,I have a form that contains a textbox and an image as a button, The textbox and the image are placed inside a table data like this:

<tr><td class="td2"><p><input type="text" size="34" name="q" id="q" /> <img src="images/b1.GIF" alt="Search!" /></p></td></tr>

And class td2 is:.td2 {width : 400px;height : 30px; text-align : center;}My image looks to be shifted to the top (NOTE: they have the both height size).See this sample:http://www.search4jordan.com/Sample.bmpSo is there any way to make them look like standing at the same line?Thanks in advance,zeid

Link to comment
Share on other sites

Take the <p> tags out of your <td>. If that doesn't work then:

.td2 {width : 400px;height : 30px; text-align : center; vertical-align: middle;}

Link to comment
Share on other sites

I tried using the <span> and align it in the middle .. This worked with IE but not FireFox..Any help?

<tr><td class="td2"><input type="text" size="34" name="q" /> <span style="vertical-align:middle"><img src="images/b1.GIF" alt="Search!" /></span></td></tr>

Link to comment
Share on other sites

I tried using the <span> and align it in the middle .. This worked with IE but not FireFox..Any help?

<tr><td class="td2"><input type="text" size="34" name="q" /> <span style="vertical-align:middle"><img src="images/b1.GIF" alt="Search!" /></span></td></tr>

Link to comment
Share on other sites

I tried this out and it worked:

<style type="text/css">.td2 input, .td2 img {  vertical-align: middle;}</style>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...