前端学习(184):BFS规范 解决margin叠加问题

安稳与你 提交于 2019-12-22 14:18:43

 

<!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>解决margin叠加</title>
    <style>
    .div{width: 100px;height: 100px;background: red;margin-bottom: 30px;}
    .div{width: 100px;height: 100px;background: blue;margin-top: 30px;}
    .box{overflow: hidden;}
    </style>
</head>
<body>
    <div class="box">
    <div class="div1"></div>
</div>
<div class="box">
    <div class="div2"></div>
</div>
</body>
</html>

运行结果

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!