I know, this has been discussed over and over again. but it still seems to be a specific understanding issue on my side. after implementing several bug fixes from here and elsewhere my site is still not working as wished. I got a fixed background-image in the header section of my page. this is working perfectly fine on normal chrome browser. however i cannot get it running on mobile chrome browser
i've got following lines of html:
<body id="page-top">
<!-- Header -->
<header class="masthead bg-head text-white text-center">
<div class="container">
<h1 class="text-uppercase mb-0">My Name</h1>
<img id="header-star" class="img-fluid" src="img/star-light.png" alt="">
</div>
</header>
aligned with the following lines of css:
body {
font-family: 'Lato';
max-width: 1280px;
margin-left: auto;
margin-right: auto;
background-color: #fff;
}
header{
background-color: #4a4a4a;
background-image: url("../img/background-bern-4.jpg");
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center top;
padding-top: 6rem;
height:500px;
}
for example i wrote a media query with height of 100% with browser specific commands and so on:
@media (max-width: 576px){
header{
height:100%;
background: url(bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
}
and then i tried to put y-overflow: scroll; to body and hidden to header enter link description here
Furthermore I tried to put the image into a div like this enter link description here html:
<!-- Header -->
<header class="masthead bg-head text-white text-center">
<div class="container header">
<h1 class="text-uppercase mb-0">My Name</h1>
<img id="header-star" class="img-fluid" src="img/star-light.png" alt="">
</div>
</header>
css:
.header{
position: fixed;
z-index: -1;
background-color: #4a4a4a;
background-image: url("../img/background-bern-4.jpg");
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center top;
padding-top: 6rem;
height:500px;
}
whit this technique the picture is gone completely after all
somewhere I must missing something, don't I?