0

This is my CSS

element.style {
    background-image: url("photo.jpeg");
    background-attachment: fixed;
    background-size: cover;
    background-position: 50% 66%;
}

The position of the photo remains (0% 0%) as if background-position never existed. Anyone knows why this happens?

Also, if I use chrome and inspect the page, and edit any of the css it applies the background-position. Say I untick the background-position and tick it back on. It will apply the effect. I'm not sure why that happens, is it getting overridden or something?

Alice
  • 701
  • 1
  • 5
  • 17
  • Add your relevant code of HTML/CSS to sort out the error. Thx – Riot Zeast Captain Apr 18 '16 at 22:17
  • The background is fixed relative to the viewport. In paged media where there is no viewport, a ‘fixed’ background is fixed with respect to the page box and therefore replicated on every page. Note that there is only one viewport per view. Even if an element has scrollable content, a ‘fixed’ background doesn’t move with the element or its content. Even if the image is fixed, it is still only visible when it is in the background painting area of the element or otherwise unclipped. – mlegg Apr 19 '16 at 00:01

0 Answers0