~~~
<style>
.parent{
width:400px;
height: 300px;
background: khaki;
}
.child{
margin-top:100px;
width: 100px;
height: 100px;
background: lawngreen;
}
/* :before某個元素里面的最前面 */
.parent::before{
content: "";
display: table;
}
</style>
~~~
> 子元素作為父元素的第一個元素,給它margin-top沒用,它的父元素變動 偽元素是在某個元素里面的最前面或者最后面
~~~
<body>
<div class="parent">
<div class="child"></div>
</div>
</body>
~~~