Can anyone help me understand how 100vh works?

Viewed 32

So I have a problem. I just really want the content to take only up to 100% of the viewport and not beyond it. As you can see on the screenshot, scrollbars appear even after setting height: 100vh.

lorem impsum height: 100vh

My code is very simple. I didn't explicitly include the entire text but you get the point.

<html lang="en" style="height: 10vh">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body style="height: 10vh">
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec at lacus condimentum, maximus felis eu, aliquet erat.
  Praesent nulla elit, scelerisque in nisi nec, lacinia vulputate libero. Phasellus scelerisque sapien eu augue laoreet.........
</body>
</html>```
0 Answers
Related