Using the :after element to add a gradient overlay to a background image. Blog post: http://alexcarpenter.me/blog/2013/background-image-gradient-overlay
Created
November 23, 2013 19:25
-
-
Save alexanderkustov/7618803 to your computer and use it in GitHub Desktop.
A Pen by Alexander.
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="bg-img"></div> |
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
| @import "compass"; | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| } | |
| .bg-img { | |
| width: 100%; | |
| height: 100%; | |
| background: url('http://i.imgur.com/lpNa36T.jpg') center center no-repeat; | |
| background-size: cover; | |
| &:before { | |
| content: ''; | |
| display: block; | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| bottom: 0; | |
| left: 0; | |
| background-image: linear-gradient(to bottom right,rgb(92, 187, 82),#2d72d9); | |
| opacity: .6; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment