issue with background attachment [closed]
i had been trying to use background attachment property and the issue that i m facing is that after i use the fixed property, the image in the background gets aligned weirdly开发者_如何转开发 ..the image moves to left .. please suggest anything that i can do to avoid this issue ..
Look into background-position
. You could add something like:
background-position: top center;
to keep it fixed to the top and center. You can also specify pixel values.
background-attachment: fixed
will position the background relative to the viewport, rather than the element the background is applied to.
This is the basis for Eric Meyer's Complex Spiral Demo. There are more specific details on the linked page.
So, unfortunately, the answer is No. You cannot avoid this behavior and still used background-attachment: fixed
精彩评论