CSS Property Value How to - height: 100%;








Question

We would like to know how to height: 100%;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
html, body {<!--  ww  w . ja v a  2  s  . c  o m-->
  margin: 0;
  padding: 0;
  height: 100%
}

div {
  width: 100px;
  height: 100%;
  background: red;
}
</style>
</head>
<body>
  <div></div>
</body>
</html>

The code above is rendered as follows: