CSS Property Value How to - font-size: 100vh;








Question

We would like to know how to font-size: 100vh;.

Answer


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

tr:nth-child(2) {
  background: #F0F0F0;
}
</style>
</head>
<body>
  <table>
    <tr>
      <td>Line 1</td>
    </tr>
    <tr>
      <td>Line 2</td>
    </tr>
    <tr>
      <td>Line 3</td>
    </tr>
  </table>
</body>
</html>

The code above is rendered as follows: