I'm trying to make a website that has multiple fixed and stretched backgrounds on some divs. Super easy, just use :
background-image:url(../some-image.jpg);
background-position: center center;
background-attachment: fixed;
background-size: cover;
on each div that needs a background but for some reason, on iOS, the backgrounds are not fixed and are not stretched to the correct size.
I found this fix here : https://css-tricks.com/forums/topic/full-page-backgrounds-on-ios-background-size-cover/page/3/
.bg {
background: url(image.jpg);
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
height: 100%;
width: 100%;
position: fixed;
background-position: center center;
background-repeat: no-repeat;
}
basically he's giving the dimensions and the fixed attribute to a div instead of the background directly. My problem is this works if you need only 1 background but I can't figure out how to do it with different backgrounds on seperate divs.