Good day. I want to know how to center backing if the code already has a position, and the margin: auto does not work.

.content{ width: 980px; height: 458px; background: url(background.png); position: absolute; z-index: 3; top: 700px; margin-left: 18.7%; } 

When you reduce the screen, backing, of course, moves, I want it to always be located in the center. Tell me, please, how can this be implemented correctly?

  • What does it mean to center? What about? What should happen? - Alexey Ten
  • Concerning the screen. Centered object, regardless of screen size. - Kira
  • background-attachment: fixed - Alexey Ten
  • It will not scroll, but it will not be centered. - Kira
  • one
    position: absolute; left: 50%; margin-left: -490px; - soledar10

1 answer 1

 .content{ /* Ваш код */ backround-position: center; } 

Description here

  • Thank you, but this method does not work. - Kira