Gary
Gary

Reputation: 1

What am I doing wrong in my css code? Div is overlapping when it shouldn't

Can somebody tell me why my H2 div is overlapping the float:right div on this page?

http://wreckedexotics.com/test3.html

I tried clear:both - that didn't work I tried making the H2 an inline with width 100%, that didn't work

Not sure what I'm doing wrong here.

As always, your help is much appreciated!

Upvotes: 0

Views: 89

Answers (1)

MatTheCat
MatTheCat

Reputation: 18721

You must establish a new block formatting context for <h2> (and maybe others). So

h2 { overflow:auto; }

will work!

Block formatting context allows container to encompass floating children elements too ^^

Upvotes: 3

Related Questions