0

I want two background image on two different sections. These code works good for the single fixed background. As soon as i apply the second background it overwrites the first one. I want both the background images fixed and should work on iPad the single fixed background is working on iPad.

Here is the demo

And here is my CSS

.booking-menu-wrapper::before{
    content: "";
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: url("http://farm3.staticflickr.com/2533/4062253262_90a3635234_o.jpg") no-repeat center top;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
.booking2::before{
  content: "";
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: url("http://uploads.webflow.com/556801b89cccf1594633da22/556807c647dc18034e5e296c_Nature271.jpg") no-repeat center top;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
label{
  width:100%;
  background:#fff;
  display:block;
  height:1000px;
  margin-top:200px;
}

Note The fixed background is not on the body tag still covering the whole page

Community
  • 1
  • 1
  • 1
    Is this what you meant? https://jsfiddle.net/a2cknLn8/2/ you can't apply position fixed on the images as they will ignore the containing parent. I applied fixed as part of the image property so it will be fixed to the parent – toast Jan 10 '17 at 07:05
  • @toast thank u for ur time,yes, these is the output i want but the fixed bg property will not work on the ipad – Harsh Desai Jan 10 '17 at 07:12
  • looks like they covered it here > http://stackoverflow.com/questions/23236158/how-to-replicate-background-attachment-fixed-on-ios – toast Jan 10 '17 at 07:48
  • @toast i have seen but they are using third party JS, i want these using css – Harsh Desai Jan 10 '17 at 08:40
  • Possible duplicate of [Fixed background image with ios7](http://stackoverflow.com/questions/20443574/fixed-background-image-with-ios7) – scoopzilla Jan 11 '17 at 06:39

0 Answers0