0

Hi,

I have a wrapper and 2 divs inside which make use of the float property.

When I put content inside one of the sub divs, the wrapper doesn't extend to the same size as the sub divs.

Hope you can understand this.

Any idea how to resolve this?

Many thanks.

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by jryans10
0

By using float you are removing the sub div from being "inside" your wrapper. You can consider it to be "floating" on top. Because it has lifted out in this way the wrapper can't wrap itself around the div. Try replacing the float command with display:inline-block for the 2 divs - that should make them appear beside each other, which is what I think you were trying to achieve with the float.

0

Or just add overflow:auto to the wrapper's css. That usually makes it expand properly. Sometimes overflow:visible works too.

0

Thank you both very much, but I followed drjohn's advice and it works perfectly.

Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.