4 ms·
If you set overflow to auto on the parent element it will retain its height.
by oneplusone 16y ago
If you set overflow to auto on the parent element it will retain its height.
- sudont 16y agoExcellent. Thanks for the tip!
- mikeklaas 16y agoI usually put a <div style="clear:both"></div> after the floats to fix that.
- sosuke 16y agoI just tested it because it sounded so beautiful but that does not work in IE6 unfortunately.
- isleyaardvark 16y agoIt has worked for me. Does the container have hasLayout?
- boundlessdreamz 16y agoYou also need to set the width. Explanation here http://www.quirksmode.org/css/clearing.html http://www.quirksmode.org/css/clearing.html
- DanielRibeiro 16y agoQuirksmode does an excelent job explaining this. And covering ie/chrome/safari bugs adds extra credit.