Skip to content

Instantly share code, notes, and snippets.

@gearmobile
Created June 23, 2015 20:20
Show Gist options
  • Save gearmobile/cdbc79021b4daa456d5c to your computer and use it in GitHub Desktop.
Save gearmobile/cdbc79021b4daa456d5c to your computer and use it in GitHub Desktop.
Gradient Over Image
HTML:
<div id="mask"></div>
CSS:
#mask {
background: url(demo.png) no-repeat 0 0 transparent;
height: 37px;
overflow: hidden;
position: relative;
width: 95px;
}
#mask::after {
background: transparent;
background: -moz-linear-gradient(top, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(255, 0, 0, 0.8)), color-stop(100%, rgba(0, 0, 0, 0.1)));
background: -webkit-linear-gradient(top, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 100%);
background: -o-linear-gradient(top, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 100%);
background: -ms-linear-gradient(top, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 100%);
background: linear-gradient(to bottom, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 100%);
content: "";
display: block;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment