views:

75

answers:

2

I have a background image set to center and needs to be fixed position. However I would like to just nudge it 100px off centre, any ideas?

CSS background: url(styles/images/bg.png) no-repeat center 0; background-attachment: fixed;

This is the working sample http://www.warface.co.uk/clients/detail-shoppe/

Many thanks

+1  A: 

looks like background-position is what you are looking for.

Check out this link for more details

Vinay B R
+2  A: 

change your css(body) to as follows

background : url("styles/images/bg.png") no-repeat fixed center center transparent;

This should fix your problem xD

Edit :

background : url("styles/images/bg.png") no-repeat fixed 150px 0px transparent

There are various values for background-position, visit the below link for reference http://www.w3schools.com/css/pr_background-position.asp

Ninja Dude
is there no way I can be more specific with placement? At the moment is central but needs to be pushed left by 150px
Rob
-150px or +150px from left ? Can u give me a hint
Ninja Dude
Thanks for this, I did try this method but unfortunately the image doesn't move when the browser is resized.I need it to stick to the central content when resized but 150px to the left of center.
Rob
@rob seems strange =)
Ninja Dude
@rob this should be working. Have you set the dimensions on div that the background is on?
danixd
Thanks for your help, it seems I cannot have too values assigned to the x of this (stick in center and -150px)This is what I have to stick the image to center for all browser sizes.background : url("styles/images/bg.png") no-repeat center 0;I will create a div to wrap the central content and place it in there
Rob