Perhaps this page offers you the solution you're looking for?
I haven't tried it yet, I bumped in to it last week.

http://www.positioniseverything.net/easyclearing.html


Good luck,
Cheers, esther


-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Jon Hughes
Enviado el: jueves, 16 de agosto de 2007 16:51
Para: css-d@lists.css-discuss.org
Asunto: [css-d] Elegant alternative to <br style="clear:both;" />?

I'm sure most of us have run into this problem before, but I couldn't
find the solution of google.

You have a container div, with multiple divs nested inside... but all of
the child divs are floating, so the contain div doesn't have layout.
(though this is not the hasLayout bug)

So, the easy solution:

<br style="clear:both;" /> right before closing the container div.

Code:
<div id="container">
<div style="float:left">Floating Left</div>
<div style="float:right">Floating Right</div>
<!-- At this moment, "container" doesn't know how tall it is, because
the two floats don't have layout) -->
<br style="clear:both;" /> <!-- This clears the two floats, thus giving
"container" layout -->
</div><!-- end container -->

Does anyone know of an unobtrusive way to do the same thing without
using the br/?

Thank You,
- Jon Hughes 
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to