Skip to content

Instantly share code, notes, and snippets.

@gearmobile
Created June 23, 2015 20:25
Show Gist options
  • Save gearmobile/18fd70c2b7167ce05217 to your computer and use it in GitHub Desktop.
Save gearmobile/18fd70c2b7167ce05217 to your computer and use it in GitHub Desktop.
Shadow Over Image via Position Relative
HTML:
<div class="block1">
<img src="images/charlize_theron_1.jpg" width="480" height="300">
</div>
CSS:
.block1{
box-shadow: inset 0 0 6px 4px rgba(0,0,0,.7);
width: 480px;
height: 300px;
}
.block1 img{
position: relative;
z-index: -2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment