0

I have a problem with fixed background in a specific section of a Wordpress website I'm working on. Here's the link

The background is fixed on PC, but on iOS and chrome android its not fixed and will scroll with content.

I've set these custom CSS for #biography Section but still doesn't work:

@media only screen and (max-width: 768px) {
#biography {
background: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url(http://yeganehhosseininia.com/wp-content/uploads/2018/04/Yeganeh3.jpg) center center !important;
webkit-background-position: center center !important;
-moz-background-position: center center !important;
-o-background-position: center center !important;
background-position: center center !important;
background-repeat: no-repeat !important;
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important;
background-size: cover !important;
-webkit-background-attachment: fixed !important;
-moz-background-attahcment: fixed !important;
-o-background-attachment: fixed !important;
background-attachment: fixed !important;
}
}

@media only screen and (min-width: 768px) {
#biography {
background: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url(http://yeganehhosseininia.com/wp-content/uploads/2019/05/Yeganeh2.jpg) !important;
-webkit-background-position: center center !important;
-moz-background-position: center center !important;
-o-background-position: center center !important;
background-position: center center !important;
background-repeat: no-repeat !important;
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important;
background-size: cover !important;
-webkit-background-attachment: fixed !important;
-moz-background-attahcment: fixed !important;
-o-background-attachment: fixed !important;
background-attachment: fixed !important;
}
}
Aria
  • 75
  • 1
  • 9

1 Answers1

0

Your code and all is correct. The background-attachment: fixed feature has been disabled in the mobile browsers.

For detail : How to replicate background-attachment fixed on iOS

Subin
  • 376
  • 1
  • 4
  • 16
  • all of those will apply to the whole website. I want it to apply to my specific section. I tried to set those fixed on `#biography` section but no luck. – Aria May 19 '19 at 15:46