ze1d Posted October 20, 2007 Share Posted October 20, 2007 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 More sharing options...
Err Posted October 20, 2007 Share Posted October 20, 2007 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 More sharing options...
ze1d Posted October 20, 2007 Author Share Posted October 20, 2007 I tried it without <p> and it stayed the same.. then I used the vertical-align : middle; and also nothing happened!! Link to comment Share on other sites More sharing options...
ze1d Posted October 20, 2007 Author Share Posted October 20, 2007 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 More sharing options...
ze1d Posted October 20, 2007 Author Share Posted October 20, 2007 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 More sharing options...
Err Posted October 20, 2007 Share Posted October 20, 2007 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 More sharing options...
ze1d Posted October 21, 2007 Author Share Posted October 21, 2007 Thanks very very much .. This work fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.