Created
November 26, 2013 23:57
-
-
Save xiaohutai/7668484 to your computer and use it in GitHub Desktop.
Background Image Gradient Overlay
From: http://alexcarpenter.me/blog/2013/background-image-gradient-overlay
Demo: http://codepen.io/alexcarpenter/details/LveDx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hero-img { | |
| width: 100%; | |
| height: 100%; | |
| background: url('/img/hero.jpg') center center no-repeat; | |
| background-size: cover; | |
| position: relative; | |
| &:after { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| bottom: 0; | |
| left: 0; | |
| background-image: linear-gradient(to bottom right,#002f4b,#dc4225); | |
| opacity: .6; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="hero-img"> | |
| ... | |
| div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment