How to shift a background image with css

Ankur picture Ankur · Jul 24, 2009 · Viewed 55.3k times · Source

I wanted to put a border around a table which has a background image. The border works fine, but when I do this (it is an 8px border) the background image gets cut off by the border. Am I able to shift the background image to start 8px to the right and 8px down?

Answer

Nathan picture Nathan · Jul 24, 2009

You can use the background-position:

background-position: 8px 8px;