...

View Full Version : div doesn't fill the screen :(



martynball
06-18-2012, 09:34 PM
For some reason the following CSS isn't making my div fill the screen. This div is inside the body and not inside another div.



.overlay_container {
position:absolute;
height:100%;
width:100%;
}


Add you can see from the screenshot below, if the other content extends past the browsers edge and cause a scroll bar to appear the div above does not expand at all, if that makes sense.

https://dl.dropbox.com/u/63494571/why_css.jpg

EpicWebDesign
06-18-2012, 11:41 PM
You could try this:

Add to CSS (change background to whatever you need):

*{
margin:0;
padding:0;
}

#overlay_container {
background: #000000 left top;
position:fixed;
width:100%;
height:100%;
}


Then call the div within the body of the HTML.

If that doesn't work, can you post a link to your page or your HTML & CSS code so we can see them?

martynball
06-18-2012, 11:58 PM
Crap, I forgot about "fixed" that works perfect, thanks :)

EpicWebDesign
06-19-2012, 12:09 AM
Glad I could help :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum