background-attachment for Parallax Effect in CSS


Create a simple parallax scrolling effect with background-attachment.

Source Code

.parallax {
    background-image: url('path/to/image.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 500px;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments