CSS Tricks – Floating Div Parent Problem covering content

I can’t believe I never looked this up and have just been doing manual adjustments until now.
When floating divs, the parent container ends up with a height=0 and content underneath the divs you floated end up squashed much higher on the page.

The fix to this is to set the CSS Style for the parent container to


That solves everything! Although having to set a style to auto seems a bit reversed to me.. but oh well.

Read more: www.quirksmode.org/css/clearing.html

About Steven Chu

Hi, I'm Steven! I'm an entrepreneur, photographer and art director in New York. Follow this blog for self expression, fun, and most importantly: looking comfortable, at ease, and amazing in your photos no matter who takes them! I dedicate this to my amazing friends who have let me inadvertently turn all of our hangouts and travel photos into a never ending photoshoot of fun. The proof is in the pudding-- our photos rock. My other projects: I'm the founder of InstaTechie.com, a face-to-face tech concierge service for NYC. Book a techie to walk you through something you want to learn! My work focuses on socially engaged art projects which use technology to create access to resources for communities. Visit Steven Chu Studio (stevenchustudio.com) for branding & design work or Steven Chu (stevenchu.com) for photography projects.

Leave a Reply