Zack Zack - 1 year ago 86
CSS Question

Make div take 100% of browser window height

how could I make sure that a div takes 100% of the height on every single screen resolution. Like here:, or here:

Answer Source

If you want to achieve a 100 view height (device height) styling on a div or other elements you can use something like this:

.full-height {
  height: 100vh;
.full-width {
  width: 100vw;
div {
  background: green;
<div class="full-height full-width"></div>

This sets the element size using viewport units, where 1 vh is 1% of the viewport's height and 1 vw is 1% of the viewport's width. You can also see an example here: you can see there that I used this to assign 100vh to the aside on the left left side.

Maybe this is relevant for you: