Created
March 13, 2011 00:18
-
-
Save csasbach/867733 to your computer and use it in GitHub Desktop.
Cross browser opacity that stops inheritance.
This file contains hidden or 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
.startOpacity{ | |
background:rgb(255,255,255); | |
background:rgba(255,255,255,0.7); | |
-ms-filter:alpha(opacity=70); | |
filter:alpha(opacity=70) | |
} | |
.stopOpacity{ | |
position:relative | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="xBrowserOpacity.css" /> | |
</head> | |
<body style="background-color:#888"> | |
<ul class="startOpacity" style="padding:8px;list-style:none"> | |
<li style="background-color:#f00;padding:2px 4px;margin-bottom:8px">In some browsrs, this background is just as transparent as the container's background.</li> | |
<li class="stopOpacity" style="background-color:#f00;padding:2px 4px;">This background is fully opaque in all browsers.</li> | |
</ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment