Last active
December 19, 2015 19:18
-
-
Save Matt-Jensen/6005168 to your computer and use it in GitHub Desktop.
Quick css snippet for a 100% viewport width and height for full screen background images and the like. Keeps everything in the flow of the DOM as well.
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
/* Parent Element */ | |
#background-container { | |
height: 100%; | |
min-height: 100%; | |
width: 100%; | |
position: relative; | |
background: black; | |
} | |
/* Child Element */ | |
#background { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
bottom: 0; | |
background: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment