1

I've got a fixed-width centered div with a fixed no-repeat background image in it, and the background image needs to be off-centered. However, when the window is resized, whether the image is fixed using percentage or pixel coordinates, it does not stay positioned correctly within the div.

Is there a way to either: 1) fix a background image to its div rather than the page, or 2) use a similar hack to the "left:50%; margin-left:/$twice-the-pixel-size-of-div-width/;" div centering hack to get the fixed background image to stay at the same spot in the centered div when the page is resized?

Adam King
  • 11
  • 1
  • 3

1 Answers1

1

Is the background-position property what you're looking for?

http://www.w3schools.com/cssref/pr_background-position.asp

afkbowflexin
  • 4,029
  • 2
  • 37
  • 61