Vh and margin of css

I set html and body to 100vh
but scroll bars appear when setting margin in body

<!DOCTYPE html>
<html lang="en">

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

<body>
  <div class="app">
    <div class="f">
      <div class="s">
        
      </div>
    </div>
    <div class="f2">
    </div>
  </div>
</body>

<style>
  html,
  body,
  .app {
    margin: 0;
    padding: 0;
    height: 100vh;
  }

  * {
    box-sizing: border-box;
  }

  .app {
    height: 100%;
  }

  .s {
    margin: 10px 0;
    padding: 10px 10px;
    background-color: red;
  }

  .f2 {
    height: 50px;
    background-color: green;
  }
</style>

</html>

codepen

Mar.17,2021

1. Add border
2 to the parent box. Add padding-top
3 to the parent box Add overflow:hidden
4 to the parent box Parent box: position:fixed
5. Parent box: display:table
6. Add a sibling element to the front of the child element

 :content:"";
  overflow:hidden;

the margin-top of the bug, child element of margin-top will infiltrate into the parent. The .s you wrote, in fact, p has margin-top, and switch to padding

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45e75-4cf0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45e75-4cf0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?