views:

213

answers:

1

I have the following css set up for my page. When the page loads the background color doesn't always take effect. I have to refresh my page once or twice before the color works. Anyone know why? The background-image isn't as tall as the entire page and it's a gradient. So I'm taking the bottom pixel color of the gradient and using that as the page bg color.

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    color: #000000;
    margin: 0px;
    padding: 0px;
    background-color: #001833;
    background-image: url(images/page_bg.jpg);
    background-repeat: repeat-x;
    background-position: left top;
}
A: 

Try:

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    color: #000;
    margin: 0;
    padding: 0;
    background: #001833 url(images/page_bg.jpg) repeat-x top;
}

(You don't need to specify 'left' if its repeating.)

Also, if you're using CSS reset (or not), make sure your body uses 100% height:

html, body {height: 100%;}
Nimbuz
That is the exact same thing as the OP posted...
NickLarsen
Used a shorthand for the background property.
rahul
Thanks! I think that did it.
geoff