Skip to content

Instantly share code, notes, and snippets.

@alexmustin
Last active September 20, 2022 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmustin/5c861314ecaa8eb4b007f29a5ee350da to your computer and use it in GitHub Desktop.
Save alexmustin/5c861314ecaa8eb4b007f29a5ee350da to your computer and use it in GitHub Desktop.
CSS background cover mobile iOS fix
/**
* This applies to Genesis Blocks that have
* a 'fixed' background image applied.
*/
.gb-has-parallax {
/**
* This is the fix for mobile (iOS).
* It displays as a normal background image which fills
* the container and scrolls with the content.
*/
background-attachment: scroll;
/**
* Keep the normal fixed behavior for larger screens.
*/
@include media-breakpoint-up(md) {
background-attachment: fixed;
}
}
/* Also ensure the .site-inner element does not have any transform applied. */
.site-inner {
transform: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment