Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Why is this div height not calculated?

Why is this div height not calculated?

Problem

Does anybody know why the Height of the yellow-box is not calculated correctly (100px)?

I need to know define the css so the JavaScript-Part knows the real height...

Here is a jsFiddle - http://jsfiddle.net/3nM7f/

Problem courtesy of: Matty

Solution

It's because you're defining it using percentages % instead of pixels px.

You need to change

.content{
    height:100%;   
    background-color:yellow;
}

to

.content{
    height:100px;   
    background-color:yellow;
}

and all your sections will appear correctly.

jsfiddle here.

Solution courtesy of: lifetimes

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Why is this div height not calculated?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×