Moshe
Moshe

Reputation: 58097

Why does wrapping div not expand around floating elements?

I have two columns in a center column. (They are all div tags.) When I set the inner divs to float:left, the outer div does not wrap around the inner divs.

Why, and how do I fix that?

Upvotes: 30

Views: 16996

Answers (2)

Ivan M
Ivan M

Reputation: 13

set overflow:visible for that div, or remove overflow property.

Upvotes: -3

Brad Mace
Brad Mace

Reputation: 27916

set overflow: auto on the outer div.

Why does setting overflow alter layout of child elements?

Upvotes: 66

Related Questions