Created
April 27, 2012 14:52
-
-
Save roc/2509894 to your computer and use it in GitHub Desktop.
Semi-transparent color masking
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
/** | |
* Semi-transparent color masking | |
* (answer to question) | |
*/ | |
.img-wrapper { | |
position: relative; | |
float:left; | |
overflow: hidden; | |
} | |
.img-wrapper img{ | |
display:block; | |
} | |
.img-wrapper:after { | |
content: ''; | |
position: absolute; | |
top: 15px; | |
right: 15px; | |
bottom: 15px; | |
left: 15px; | |
/*width: 325px;*/ | |
/*height:325px;*/ | |
/*bigger than half the element is */ | |
border-radius:350px; | |
box-shadow: 0 0 0 350px rgba(255,255,255,.7); | |
background:rgba(0,0,0,.7); | |
} |
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
<div class="img-wrapper"> | |
<img src="http://lorempixel.com/output/animals-q-c-350-350-1.jpg" /> | |
</div> |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment