Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cwhite92/a8bd998c084a94c061acc81e0a04b477 to your computer and use it in GitHub Desktop.
Save cwhite92/a8bd998c084a94c061acc81e0a04b477 to your computer and use it in GitHub Desktop.
// I can achieve a background image with a semi-transparent overlay by using multiple CSS backgrounds...
.cover {
background: linear-gradient(rgba(255, 0, 0, 0.45), rgba(255, 0, 0, 0.45)), url(image.jpg);
}
// This works fine, but I'm specifying what image to use on my covers like this:
<div class="cover" style="background-image: url('<?php the_field('homepage_cover_image'); ?>');">
</div>
So, my question is:
How in the fuck can I utilise multiple background images while specifying one of them via the "style" attribute of a div?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment