Skip to content

Instantly share code, notes, and snippets.

@lightyrs
Created January 12, 2012 03:01
Show Gist options
  • Save lightyrs/1598305 to your computer and use it in GitHub Desktop.
Save lightyrs/1598305 to your computer and use it in GitHub Desktop.
Black Glass CSS3
http://dev.opera.com/articles/view/beautiful-ui-styling-with-css3-text-shadow-box-shadow-and-border-radius/
Here I’ve applied rgba colours to the shadows, so most of this box is semi-transparent. I have added a second div around the first one with a repeating background pattern image applied to it, so you can appreciate the full extent of this effect.
div {
width: 100px;
height: 100px;
margin: 10px;
padding: 0;
border: 1px solid rgba(0,0,0,0.5);
border-radius: 10px 10px 2px 2px;
background: rgba(0,0,0,0.25);
box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
-o-box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
-moz-box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment