tags:

views:

15

answers:

1

I have a problem. My css body background looks like this:

background: url(../doubletwo.jpg) top center repeat-x #000; 
background-attachment: fixed;

doubletwo.jpg is 8px × 580px now im starting adding more content to my site, and after the 580px has ended, it displays the color #000.

I want to like keep the background STUCK and should not scrolling with the site, so the pixels of the heigh ends and it shows #000.. how can i solve this? As you see i tried background-attachment: fixed; but i dont know if its right, but it doesnt seem to as it dont work..

A: 

I am assuming you have the background on the body css selector. You need to set the overflow to scroll.

body
{
    background: url(../doubletwo.jpg) top center repeat-x #000;
    overflow:scroll;
}

That will stop the body for growing beyond the screen and then your content will scroll inside the body.

Dustin Laine
This didnt solve the problem, it just added a width scroller in my browser, which is kinda ugly..
Karem
If you use `overflow:auto` instead it will only show scroll bars when necessary. You shouldn't have to change the overflow on `body` at all, though.
qmega