HTML background image offset by x pixels from the center

后端 未结 9 1392

I\'d like to put an image as the background of a webpage but have it offset by some number of pixels with respect to the center.

How can I do this?

I want:

9条回答
  •  余生分开走
    2020-12-23 09:49

    So you want it centered by shifted 50 pixels to left. I would add the 50 pixels to the image in the form of a transparent space, unless you are dealing with absolute dimensions.

提交回复
热议问题