When the mobile terminal sets 100vw for the container, scrolling to solve

Trouble, directly upload the code and use it directly next time

<!DOCTYPE html>
<html lang="en">
  <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>
  <style>
    html,
    body {
      margin: 0;
      padding: 0;
    }
    * {
      box-sizing: border-box;
    }

    body {
      height: 100vh;
      width: 100vw;
    }
    .container {
      height: 100vh;
      border: 3px;
      box-sizing: border-box;
      width: 100vw;
      /* height: 100vh; */
      background: url("https://img.js.design/assets/img/63ef2b5568826c11e82c2c4a.jpg#b94719d8fcee1307747879bcc66e92e8")
        no-repeat;
      background-position: left center;
      background-size: cover;
      margin: 0;
      padding: 0;
    }
  </style>
  <body>
    <div class="container"></div>
  </body>
</html>

Guess you like

Origin blog.csdn.net/Motion_zq/article/details/129176237