I have a site created in the "pages" section for vertical scrolling. The first page is 100% width and height, like other sections, but has a background image that scrolls and stretches to the width of the browser. I try to maintain this, as well as fix the position. therefore, it is held still, and the content below scrolls up and over the background image.
So my question is how to add a property fixedto the center background-position:center;
<div class="page-section home-bg clear" id="home">
</div>
<div class="page-section clear" id="about">
<div class="wrapper" style="background-color:#fff;">
</div>
</div>
.page-section {
width:100%;
margin:0px auto 0px auto;
overflow-x:hidden;
}
.home-bg {
height:100%;
background:url('img/home-bg.jpg') no-repeat;
background-position:center center;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
z-index:1;
}
source
share