Created
February 16, 2016 17:33
-
-
Save LadyCarni/ec168fc500f17a5d3cc3 to your computer and use it in GitHub Desktop.
Better fixed background image
This file contains 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
html,body { | |
height: 100%; | |
margin: 0 | |
} | |
.hero { | |
min-height: 100%; | |
position: relative; | |
overflow: hidden; | |
&::before { | |
background-image: url('http://bit.ly/1KnDNGG'); | |
background-repeat: no-repeat; | |
background-position: center top; | |
background-size: cover; | |
content: ''; | |
height: 100%; | |
left: 0; | |
position: fixed; | |
top: 0; | |
width: 100%; | |
will-change: transform; | |
z-index: -1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment