Reputation: 1863
I have a photo positioned as my background photo for my landing page. As I scroll down, I'd like the photo's positioning to remain the same relative to the viewer, but I'm having issues doing this.
In this person's website, for example, the girl's face has the same positioning even as you scroll and advance to the next part of the page. Help is greatly appreciated!
Upvotes: 0
Views: 25
Reputation: 41065
Use CSS background-attachment: fixed
(https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment)
body {
background: url(mypicture.png) no-repeat;
background-attachment: fixed;
}
Replace mypicture.png with your image path
Upvotes: 1