Created
June 8, 2014 09:28
-
-
Save FutureMedia/9d7a43d6f165f7566ff7 to your computer and use it in GitHub Desktop.
Normally to set the height of an element in relation to the browser window you need javascript. You can do the same using css Viewport Percentage Lengths.
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
.box { | |
height: 100vh; | |
width: 50vw; | |
} | |
/* | |
Note: The CSS height property is a bit tricky. | |
Setting the height:100% should make an element 100% the height of its parent. | |
This works, yes, but only when the parent has a fixed height. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment