Skip to content

Instantly share code, notes, and snippets.

@FutureMedia
Created June 8, 2014 09:28
Show Gist options
  • Save FutureMedia/9d7a43d6f165f7566ff7 to your computer and use it in GitHub Desktop.
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.
.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