How to deal with IE7 not determining the width of floated items correctly?
问题 Frequently in my projects, I use floated elements. This all plays pretty nicely until IE7 gets involved and starts mucking things up. Take this code, for example: HTML <div id="container"> <div id="element-1" class="left"> Some content </div> <div id="element-2" class="right"> Some much longer, more complicated content </div> <div class="clear"></div> </div> CSS .left { display:block; float:left; } .right { display:block; float:right; } .clear { clear:both; visibility:hidden; } In a lot of