Site background image fix

GK User
Mon May 13, 2013 9:58 pm
Hi again ;)

I want to know what i have to add on overide.css for a fix background image (The background image stay at the top when scrolling)

Here the code i have but the background move ;)
Code: Select all
body {
background:url(../images/style1/bg_body_main.jpg) top left repeat !important;
}
User avatar
Junior Boarder

GK User
Mon May 13, 2013 10:14 pm
Hi,
Probably you forgot to add:
Code: Select all
background-position:fixed;


it keeps the background image in place so long as the element is tall enough for scrolling.
User avatar
Platinum Boarder

GK User
Mon May 13, 2013 11:46 pm
Thx a lot ;)

Here's the exacly code :)
Code: Select all
body {
background:url(../images/style1/bg_body_main.jpg) top left repeat fixed !important;
}


Great support thx again!!
User avatar
Junior Boarder

GK User
Tue May 14, 2013 6:17 pm
No problem,
I suggest to add also this:

Code: Select all
background-size: cover;


Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area. Info from: w3schools.com
User avatar
Platinum Boarder

GK User
Mon May 20, 2013 3:36 pm
Ok Thanks a lot :P
User avatar
Junior Boarder


cron