views:

123

answers:

2

The background-position property can be set in a variety of ways such as "top right" or "16px 16px" or "50% 75%" etc.

Question: is there a way to position a background image then offset that position?

For example: set the background-position to "top right" then shift it left 16px and down 16px using "-16px 16px"?

+1  A: 

I don't think this can be done with (crossbrowser) CSS. You will have to use javascript for this one.

For IE you could have a look at CSS expressions, but as mentioned, not really crossbrowser, as in IE only :)

Nicky De Maeyer
+1  A: 

you can set a static value for background-position e.g. background-position:800px 10px 0px 0px;

Treby
This option works, but I'm looking for a method that doesen't require knowing the width/height of the element.
smchacko