Jump to content
Sign in to follow this  
danceyrselfclean_admin

Static background image with scrolling page?

Recommended Posts

danceyrselfclean_admin

Hi im looking to be able to have a static background image that doesnt move when you scroll down the page. Ive tried a number of combinations but i cant quite seem to get it right. Does this code look about right? body { background-image:url(http://www.danceyrselfclean.com/wp-content/uploads/2011/06/VinylStoreBackgroundresized1.png'); background-repeat:no-repeat; background-attachment:??????; } Then where i have put ?????? type in something like scroll or fixed

Share this post


Link to post
Share on other sites
timlinson

Yes, that should work. Actually the image and repeat properties can be set in the Design Control tab, so you could then further simplify it to: `body {background-attachment:fixed}`

Share this post


Link to post
Share on other sites
danceyrselfclean_admin

Ok thanks, i think i might have worded the question wrongly as well. I need the image to be fixed on the page so you only always see the same background no matter how far down the page you scroll. Hope this makes it clearer.

Share this post


Link to post
Share on other sites
cmunns

What is the link to your site...it depends on the page mode you have.

Share this post


Link to post
Share on other sites
danceyrselfclean_admin

www.danceyrselfclean.com

Share this post


Link to post
Share on other sites
danceyrselfclean_admin

Ive been putting it in the custom code box, have i been going about it all wrong

Share this post


Link to post
Share on other sites
Kate

I'm actually not seeing the CSS you added. (It's fine to add it in the Custom Code box. Base.css just takes precedence over that code.) Have you tried adding the !important declaration?

Share this post


Link to post
Share on other sites
danceyrselfclean_admin

I havent tried adding the important declaration, im not sure exactly what that is so ill go and read up on it. An example of what im after is on http://nofearofpop.net/

Share this post


Link to post
Share on other sites
cmunns

You're looking for something like this: ` #page, .canvas #page-canvas, { background-attachment:fixed!important; } `

Share this post


Link to post
Share on other sites
jayswat

What do you mean? I do not see a base.css file.

Share this post


Link to post
Share on other sites
timlinson

You might not have one depending on how new your version is. But where did you put it then? I don't see either rule in your site styles.

Share this post


Link to post
Share on other sites
jayswat

After reading this I think I understand what you are talking about. http://www.pagelines.com/forum/topic/10150 I have my base theme activated and I have pasted the 2 codes suggested above into my style.css file Background is still moving.

Share this post


Link to post
Share on other sites
timlinson

Take out the last body rule and just leave in Adam's. It works fine for me when I test your site with it in firebug.

Share this post


Link to post
Share on other sites
jayswat

I took out the last line. Updated. No change.

Share this post


Link to post
Share on other sites
catrina

Try this (it doesn't have the apostrophe after #page-canvas):

#page, .canvas #page-canvas {
	  background-attachment:fixed!important;}


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
jayswat

Good eye Catrina! It was that comma after #page-canvas that was preventing it from making the change. Thank you to everyone that helped out!

Share this post


Link to post
Share on other sites
danceyrselfclean_admin

Cheers, i also got mine working thanks to everyones help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×