Skip to content

Instantly share code, notes, and snippets.

@javadoug
Created August 6, 2015 16:56
Show Gist options
  • Save javadoug/fbc407754e5691ea0524 to your computer and use it in GitHub Desktop.
Save javadoug/fbc407754e5691ea0524 to your computer and use it in GitHub Desktop.
create transparent background images in css trick
/* from https://css-tricks.com/snippets/css/transparent-background-images/ */
div {
width: 200px;
height: 200px;
display: block;
position: relative;
}
div::after {
content: "";
background: url(image.jpg);
opacity: 0.5;
top: 0;
left: 0;
bottom: 0;
right: 0;
position: absolute;
z-index: -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment