Forum Moderators: not2easy

Message Too Old, No Replies

clear: both

         

Emperor

4:02 pm on May 15, 2009 (gmt 0)

10+ Year Member



Hi guys,

Should I do it like this:

<div class="wrapper">
<div style="float: left;">image</div>
<div style="float: left;">image</div>
<div style="clear: both;"></div>
</div>

or like this...

<div class="wrapper">
<div style="float: left;">image</div>
<div style="float: left;">image</div>
</div>
<div style="clear: both;"></div>

Thanks,
Robert

rocknbil

2:25 am on May 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But a border on wrapper.

<div class="wrapper" style="border:1px solid #000000;">

You will see that in the first case, the wrapper will enclose both divs, in the second case it will just clear any elements below wrapper and likely render as what looks like a single black line above the two divs.

It just depends on what you need.