Ok, I get what you want. But I wouldn't consider that an elegant solution. There are other solutions to clear floats.
If you really are absolutely sure there is no other option then to insert a meaningless element just for the sake of clearing something, I would use a br or hr. Then use css to hide them (br class="hidden or hr class="hidden"). A hr would somehow make a little sense. When you would view the document unstyled, a hr displays as a kind of section separator.
matthijs wrote:Ok, I get what you want. But I wouldn't consider that an elegant solution. There are other solutions to clear floats.
If you really are absolutely sure there is no other option then to insert a meaningless element just for the sake of clearing something, I would use a br or hr. Then use css to hide them (br class="hidden or hr class="hidden"). A hr would somehow make a little sense. When you would view the document unstyled, a hr displays as a kind of section separator.
I like the idea of hr, but I can't seem to get rid of the border or height in IE.
I just set border:none; and height:0px. And it left a gray horizontal line in IE.
Although br makes sense to, and it works. But I'd like to get rid of all the default behaviors that br has.
In most cases when I want a containing element to clear I float it as well. Say you'd have a layout with 3 horizontal boxes wrapped in a div, and below that again a wrapper div with a few boxes. You float the little boxes. Then to have the wrapper divs not collapse I float them as well and just give them a width of 100% (no margin or padding horizontally to prevent box-model problems).