Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created June 1, 2021 14:52
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 mikeoberdick/8b88fdbd052ea06423409746a9f00b7d to your computer and use it in GitHub Desktop.
Save mikeoberdick/8b88fdbd052ea06423409746a9f00b7d to your computer and use it in GitHub Desktop.
Parallax effect for background images
<section id="sectionFour">
<?php $img = $four['full_size_image']; ?>
<div class="parallax" style = "background: url('<?php echo $img['url']; ?>');"></div>
</section><!-- #sectionFour -->
.parallax {
min-height: 500px;
background-attachment: fixed !important;
background-position: center !important;
background-repeat: no-repeat !important;
background-size: cover !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment