Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post

    div doesn't fill the screen :(

    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.

    Code:
    .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

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    You could try this:

    Add to CSS (change background to whatever you need):
    Code:
    *{  
     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?

  • Users who have thanked EpicWebDesign for this post:

    martynball (06-18-2012)

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post
    Crap, I forgot about "fixed" that works perfect, thanks

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    Glad I could help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •