<div class="height">
  <h2>Make a <code>&lt;div&gt;</code> 100% Height of Browser Window (Using <code>vh</code> Units)</h2>
  
  <p>The element with the blue backround stretches to fill its parent no matter the size of the window. This uses <code>vh</code> units to achieve this effect.</p>

</div>
* {
  box-sizing: border-box;  
}

body {
  font-family: Arial, sans-serif;
  font-size: 20px;
}

.height {
  text-align: center;
  margin: 0 auto;
  max-width: 600px;
  background: lightblue;
  padding: 0 20px;
  height: 100vh;
}

h2 {
  padding-top: 20px;
  margin: 0;
}

p {
  text-align: left;
  padding: 0 20px;
}

code {
  color: firebrick;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.