Created
July 25, 2015 04:39
-
-
Save taniarascia/711e7ed7e9821f8fdea1 to your computer and use it in GitHub Desktop.
Overlay a color and opacity to a background image
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
.box { | |
width:350px; | |
height:150px; | |
} | |
.fade { | |
position: relative; | |
} | |
.fade:after { | |
background-color: red; | |
position: absolute; | |
top:0; | |
left:0; | |
width:100%; | |
height:100%; | |
opacity:0; | |
transition: opacity .25s ease-in-out; | |
-moz-transition: opacity .25s ease-in-out; | |
-webkit-transition: opacity .25s ease-in-out; | |
} | |
.fade:hover:after { | |
opacity: .5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment