Have a look at Sitepoint's very own article on how to markup and style forms. I've used this for my site, and I've not had problems getting elements to clear properly on IE.
| SitePoint Sponsor |
Have a look at Sitepoint's very own article on how to markup and style forms. I've used this for my site, and I've not had problems getting elements to clear properly on IE.
Maybe I'm a bit late on this, but...
If you can't change the HTML, I'd try floating just the label. It will push the INPUT element to the right no matter if the INPUT is floated or not.
After thatmaybe , the "clear" CSS property works as expected.






Huh?
They are both floated, and because the following label is also float: left, its "clear: left" is ignored by IE only. All IE's except 8.I have a form where each label + corresponding input box are both set to 'float: left'
The advantage to Yuri's margins is, it may make the input wide enough that the following label is simply forced to stay below due to there not being enough room for it to sit alongside as the OP's original labels were doing:
label1 input1 label2
input2
Although in any complicated form, without true clearing you get problems whenever labels with any meat appear. If the inputs aren't floated and they aren't inside a block container together with the label, then a "tall" label (multiline) will cause the next label's input to ride up:
label1 is rilly input1
rilly long and
makes 2 lines input2
or 3 lines...
label 2 input3
they stop lining up.
I use my block containers to stop the riding up.
Of course the OP never posted any HTML code so we can only speculate on what he has to work with.

Plus I doubt he is coming back..I posted the soltuion to this problem twice so hopefully he does come back.
Twitter-@Ryan_Reese09
http://www.ryanreese.us -Always looking for web design/development work
I figured you guys were enjoying a debate! Wasn't expecting over 800 hits though
But I sorted it with the negative marginsThanks for your help
Bookmarks