How can I make my background still
|
|
JoãoP | Date: Wednesday, 2009 September 16, 7:16 PM | Message # 1
|
Private
Group: User
Message: 12
[ ]
Offline
| Hey, I have design 878 and I wanted to know how I can make my website background stay still when I move up and down.. So when I go down the background doesnt move down.. it stays in the same place.. Thanks.
|
|
| |
Yosho | Date: Wednesday, 2009 September 16, 8:55 PM | Message # 2
|
Sergeant
Group: User
Message: 39
[ ]
Offline
| You can add this to the opening body statement: <body bgproperties="fixed" background="images/background.gif"> bgproperties="fixed" is one way to do it. You can also use a style sheet - you place this before the </head>: <style type="text/css"> BODY { background: white url('images/background.gif') fixed; } </style> and if you want this image only once & not tiled: BODY { background: white url('images/backgrounds/generichdr.gif') fixed no-repeat; } </style>
|
|
| |
JoãoP | Date: Wednesday, 2009 September 16, 9:19 PM | Message # 3
|
Private
Group: User
Message: 12
[ ]
Offline
| Where do I exactly put the code in?? lol Thanks anyways..
|
|
| |
Yosho | Date: Wednesday, 2009 September 16, 9:22 PM | Message # 4
|
Sergeant
Group: User
Message: 39
[ ]
Offline
| Ok, let me see... will post the answer in two hours!
|
|
| |
Brazen | Date: Thursday, 2009 September 17, 0:58 AM | Message # 5
|
Colonel
Group: Administrator
Message: 304
[ ]
Offline
| To make the background still/fixed go to: CP » Customize design » Common templates » Style sheet (CSS) On the 10th line replace this code: Quote #centerBlock {background:url('/.s/t/878/1.jpg') top center no-repeat #303030;padding-top:20px;} with this code: Quote #centerBlock {background:url('/.s/t/878/1.jpg') top center no-repeat #303030; background-attachment:fixed; padding-top:20px;} Code in the blue is what got added. Yosho beet you to it!
LOL With Us! l Game Blog l 3D Autos "knowledge without wisdom is curse" Alex Seb
|
|
| |
JoãoP | Date: Thursday, 2009 September 17, 1:22 AM | Message # 6
|
Private
Group: User
Message: 12
[ ]
Offline
| thanks
|
|
| |
kostova | Date: Thursday, 2009 September 17, 5:59 AM | Message # 7
|
Colonel
Group: Administrator
Message: 268
[ ]
Offline
| Quote #centerBlock {background:url('/.s/t/878/1.jpg') top center no-repeat #303030; background-attachment:fixed; padding-top:20px;} That seems a little redundant and way too much coding for one element. I like Yosho's way of coding, not to be rude or anything. Reduce it to this: Quote #centerBlock {background:#303030 url(/.s/t/878/1.jpg) no-repeat fixed;padding-top:20px;} Sweet, zen, and simple. There is no need for the quotations inside the url field, but if you want to do the extra work to type it, lol, that's fine. Please do mind me, I'm more of an html/css valid type of person...obsessive compulsive on this.
Edited Byheysupp - Thursday, 2009 September 17, 6:39 AM |
|
| |
Brazen | Date: Thursday, 2009 September 17, 8:24 AM | Message # 8
|
Colonel
Group: Administrator
Message: 304
[ ]
Offline
| Quote (heysupp) #centerBlock {background:#303030 url(/.s/t/878/1.jpg) no-repeat fixed;padding-top:20px;} That is weird I tried this method first but it did not work for me so I went with the code I provided on top. So, I just doubled checked the code right now that you provided and it actually worked, I guess when I was doing it the first time I did not save it or something like that. So, yes it is better to go with just fixed than background-attachment:fixed; Both of this codes will get the job done it is just the fixed takes less space and it is the proper way to do it.
LOL With Us! l Game Blog l 3D Autos "knowledge without wisdom is curse" Alex Seb
|
|
| |
kostova | Date: Thursday, 2009 September 17, 8:56 AM | Message # 9
|
Colonel
Group: Administrator
Message: 268
[ ]
Offline
| Yep. That's the way I've always done it (fixed instead of background-attachment:fixed;) It should go by alphabetical order, so that when the stylesheet is read by the client's computer, it loads faster. Anyways, a little off topic again
|
|
| |