Skip to content

Instantly share code, notes, and snippets.

@jegtnes
Created June 15, 2012 16:27
Show Gist options
  • Save jegtnes/2937421 to your computer and use it in GitHub Desktop.
Save jegtnes/2937421 to your computer and use it in GitHub Desktop.
:after hack to apply background-color above background-image without extra markup
header:after {
background-color: rgba(0, 0, 0, 0.3);
content: "";
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
header {
background-image: url(foo.png);
position: relative;
z-index: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment