Usually, when I have floating elements inside a container div, I will have something like this:
<div class="container"> <div style="float: left;">content</div> <div style="float: left;">content</div> <div style="clear:both;"></div> </div>
I find it extremely annoying and ugly to have <div style="clear:both;"></div> on every fluid part of the layout. So I tried to do something similar (using css, but for simplicity):
<div class="container" style="clear:both;"> <div style="float: left;">content</div> <div style="float: left;">content</div> </div>
And it didnβt work out. Is it possible to make it work by adding something to the .container class?
source share