<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            border:10px solid black;
        }
        .content{
            width: 400px;
            height: 400px;
            background: red;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="content"></div>
    </div>
</body>
</html>

IE6下效果

兼容性— IE6下子元素宽高会撑大父级

其他浏览器下效果

兼容性— IE6下子元素宽高会撑大父级

 

解决方案:编写代码时,尽量使子级元素宽高小于父级

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2021-12-23
猜你喜欢
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-12-26
  • 2022-02-08
相关资源
相似解决方案