<!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>
<style>
*{
margin: 0;
padding: 0;
}
div{
width: 100px;
height: 100px;
background-color: blue;
}
.one{
margin-bottom: 10px;
/* margin-bottom: 30px; */
/* 1.只给其中一个标签设置外边距 */
/* 外边距合并规则:如果两个都是正数 会取最大的外边距进行设置
如果两个都是负数:取绝对值最大的 高度-绝对值
如果其中一个是负数一个正数:相加
*/
/* 2.给下边外边距开启bfc
display:inline-vlick/flex
position:absolute/fixed
float:left
3.给上边兄弟设置一个父元素给父元素开启bfc
*/
}
.two{
margin-top: 20px;
}
</style>
</head>
<body>
<div class="one"></div>
<div class="two"></div>
</body>
</html>