Last active
December 18, 2015 16:39
-
-
Save pads/5813236 to your computer and use it in GitHub Desktop.
A collection of CSS hacks
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
/* For IE7 & 8 */ | |
.transparent-black { | |
/* IE7 needs an element to be positioned in order to apply a transparent background, this is a work-around */ | |
zoom: 1; | |
background-color: #000; | |
filter: alpha(opacity=70); | |
/* Fill the parent container */ | |
position: absolute; | |
top: 0; | |
left: 0; | |
height: 100%; | |
width:100%; | |
} | |
/* For all other browsers - requires modernizr */ | |
.rgba .transparent-black { | |
background: rgba(0, 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
<section style="position: relative;"> | |
<div class="transparent-black"></div> | |
<!-- Other stuff that won't end up transparent --> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment