Created
November 16, 2013 02:59
-
-
Save carlos-sanchez/7495377 to your computer and use it in GitHub Desktop.
Tinted images with multiple backgrounds.
Instead of using a transparent flood color using rgba() or hsla(), we can use a gradient. Gradients are technically background-images and thus not subject to the rule where they can't come first (be top) in the stacking order.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Working method */ | |
.tinted-image { | |
background: | |
/* top, transparent red, faked with gradient */ | |
linear-gradient( | |
rgba(255, 0, 0, 0.45), | |
rgba(255, 0, 0, 0.45) | |
), | |
/* bottom, image */ | |
url(image.jpg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment