Jump to content

Archived

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

demon_athens

textfield alignment problem

Recommended Posts

I am going mad... please somebody help. I just want a search form to be in a certain table with middle vertical-align

so Although this code works great in firefox, IE doesn't align the form in the middle like it should be ( vertical-align)

[code]<td class="serachbox"><form name="form1" method="post" action=""><table width="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr><td width="90%" valign="middle"><div align="center"><input name="textfield" type="text" class="formbox" size="35" maxlength="20">
          </div>
            </td><td valign="middle"><div align="left"><input name="imageField" type="image" src="template/common/arrow.gif" width="15" height="10" border="0"></div></td>
        </tr></table></form></td>[/code]

and the css

[code].serachbox {
    height: 41px;
    text-align: center;
    
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #000000;
    vertical-align: middle;
    background-color: #999999;
}
.formbox {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #000000;
    background-color: #FFFFFF;
    border: 1px dashed #CCCCCC;
}[/code]

any ideas what goes wrong with this simple textfield alignment by height in Internet Explorer? I have IE 6.0+

Share this post


Link to post
Share on other sites
Simple. IE doesn't support vertical-alignment, most likely. Why? Because IE is bad with CSS.

Share this post


Link to post
Share on other sites
[!--quoteo(post=362608:date=Apr 7 2006, 02:36 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Apr 7 2006, 02:36 PM) [snapback]362608[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Simple. IE doesn't support vertical-alignment, most likely. Why? Because IE is bad with CSS.
[/quote]

ok, guys, let's at least read up on our facts before we start spouting things like this off... if you'll check a simple reference chart, vertical-align has been supported since IE 4: [a href=\"http://www.w3schools.com/css/css_reference.asp\" target=\"_blank\"]http://www.w3schools.com/css/css_reference.asp[/a]

the problem is simply that IE interprets a large margin on the bottom of a form element that forces your content UP within the table cell. if you'll add a margin: 0; padding: 0; to your form tag, you should be fine.

Share this post


Link to post
Share on other sites
Sorry if I said it in the wrong way. What I meant to say was that I thought that maybe IE didn't support it, given how often that seems to happen.

Share this post


Link to post
Share on other sites
THANK YOUUUUuu obsidian! Works great!! game over at lastttttt. Come to greece to buy you a greek coffee when ever you want!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.