Reputation: 106
I'm having an issue with height of a div
element in my code.
Take a look at this example: http://jsfiddle.net/qUfr8/
...and now this: http://jsfiddle.net/DdUbr/
Pay attention on the red border. It's fine in the first example, but not in the second.
The only difference between those examples is that I added two div
elements to the second code and now the height of content
is equal to 0, but the content
is still displayed, though.
How I can fix this issue?
Upvotes: 2
Views: 114
Reputation: 1
Another way to fix it is adding "display: inline-block" to your #content:
Upvotes: 0
Reputation: 656
You need to use a clear fix if your floating elements inside a div
http://www.webtoolkit.info/css-clearfix.html
jsFiddle example: http://jsfiddle.net/DdUbr/2/
Upvotes: 3