浏览器页面缩小时, div宽高值会变大?这是什么情况

这是网页100%大小的时候, 显示正常

clipboard.png

这首页面缩小到90%的时候:

clipboard.png

请问这是什么原理呢

页面代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    *{margin: 0;
    padding: 0;}
    body{
      margin: 100px;
    }
    .wrap{
      overflow: hidden;
      /*width: 303px;*/
      width: 302px;
    }
    .h40{
      height: 40px;
    }
    .left{
      float: left;
      /*width: 100px;*/
      width: 99px;
      border:1px solid #ddd;
      border-right: 0;
      background-color: #f0f0f0;
    }
    .right{
      float: left;
      width: 200px;
      background-color: #f5f5f5;
      border: 1px solid #f44;
    }
  </style>
</head>
<body>
  <div class="wrap">
    <div class="h40 left"></div>
    <div class="h40 right"></div>
  </div>
</body>
</html>
阅读 3.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进