RSS

Background Gets Cut Off – Set CSS Element to 100%

23 Jul

When setting background container’s (<div>) height to 100% in CSS, what I see is this:

The background doesn’t fill up to the whole screen although I have set my background div container to 100%. The page looks ok when the window is smaller:

In order to solve this problem, I will have to set the parent’s container to 100% and the background container to min-height instead of height. In my case, my background container (<div>) is under <body>. So, here my css:

body
{
    height: 100%;
}
#background
{
    min-height: 100%;
}
Advertisements
 
Leave a comment

Posted by on July 23, 2011 in General

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: