...

View Full Version : Fixed background images



BlueCat
05-16-2008, 01:32 AM
Hi,

I would like to have 2 images in the background. One in the bottom left and the other one in the bottom right. I would like then to be fixed too, so when I'll scroll the images will always be visible.

Right now my images are at the right position but I can't have them fixed.
Tried the background-attachment: fixed but it doesn't work.
Here's what I have:


#left {background-image: url(http://img158.imageshack.us/img158/9608/lolbackgroundfh2.png);
background-attachment: fixed
background repeat: no-repeat;
width:174px;
height:489px;
position:absolute;
left:0px;
bottom:0px;}

#right {background-image: url(http://xs227.xs.to/xs227/08204/210649b237.jpg);
background-attachment: fixed
background repeat: no-repeat;
width:156px;
height:220px;
position:absolute;
right:0px;
bottom: 0px;}


If anyone have any other way to fix to images so that they stay there when I scroll i'm open to suggestions.

Thanks

9homie
05-16-2008, 07:16 AM
I am a novice, so i am guessing here.
But you could put them in a div... and then fix that div...

BabyJack
05-16-2008, 07:20 AM
According to my experience, the background 'snippets' will only work on the 'body' section of your CSS. Your CSS is right, it's just that you can't get these backgrounds to work.

If you want to try, then I am right saying use <p class="right"></p>.

Or, have you ended both <div>'s?


BabyJack

abduraooft
05-16-2008, 07:21 AM
If you change the position from absolute to fixed,to the above two selectors, #left & #right, their corresponding elements would be fixed, in standard browsers like FF, Opera etc. (Then no need to apply fixed for the background)

FWDrew
05-16-2008, 07:35 AM
Is something like this want your wanting? :)

http://drewsdesigns.com/codingforums/bluecat_fixed_background.html

Drew

EDIT-

According to my experience, the background 'snippets' will only work on the 'body' section of your CSS. Your CSS is right, it's just that you can't get these backgrounds to work.

This is incorrect, you can use background images anywhere in your css, your experience must have just been very bad.

effpeetee
05-16-2008, 09:05 AM
Try this site .

http://bonrouge.com/~faq

CSS
body {
background:white url(myimage.jpg) no-repeat 65&#37; 70px fixed;
}

Frank



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum