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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    body background color won't fill browser window

    For some reason, my body background color declarations won't fill up the entire page if there isn't enough content to reach the bottom. I've noticed this on Firefox and Safari- but IE seems to work fine. Here is my current declaration:

    body
    {
    padding: 0;
    margin: 0;
    background-color:#313C42;
    color:#FFF ;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;

    }

    I've attempted to add dimensions like width:100%; and height:100%; however they don't seem to have any effect. Additionally I have tried almost every single doctype under the sun. And still, there is white space. Interestingly enough, when I resize the window- the color will fill the space.

    To see an example: http://wholesystemsdesign.com

    Has anyone else struggled with this issue?

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Can't say I have, and what is ever stranger is that when I hovered over the white block at the bottom with my color picker tool in FF it suddenly filled the gap!

    Anyways, to sort the problem, you could just add the background colour to the HTML rather than the body, which I believe is only the height of the body in FF whereas IE wrongly stretches it to the window. The HTML is the only tag that should take up the spare space in the window.
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools


  •  

    Posting Permissions

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