I have background image that is resizing a little bit when I scroll from the top on mobile devices. And it returns to its size when I scroll to the top again. You can see it here
I tried using
background-attachment: fixed;
besides all the other css code you can see below but it did not work.
css
.bg-1, .bg-2, .bg-3,
.bg-1:after, .bg-2:after, .bg-3:after {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
z-index: 0;
}
.bg-1 li span, .bg-2 li span, .bg-3 li span {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
color: transparent;
background-size: cover;
background-position: 50% 50%;
background-repeat: none;
opacity: 1;
z-index: 0;
}
.bg-1 li span { background-image: url(../images/slide-1.jpg); }
.bg-2 li span { background-image: url(../images/slide-3.jpg); }
.bg-3 li span { background-image: url(../images/slide-2.jpg); }
ol,ul {
list-style:none;
}
html
<body>
<ul class="bg-2">
<li><span></span></li>
</ul>
<nav class="navbar">
<div class="container-fluid social-nav">
...
Just to explain, it is a list because if I want to make a slide gallery it works adding more
<li><span></span></li>
But I use slide only in home page.
How can I prevent that resizing?