少BB,先总结:
- 外边距(margin)
- 定位(position)
- 2D移动(transform)
问题:如何将绿盒子向下移动200px?
html代码
<body>
<div class="box">
<div class="one"></div>
<div class="two"></div>
</div>
</body>
CSS代码
<style>
.box{
height: 500px;
width: 500px;
background-color: darkgrey;
}
.one{
width: 100px;
height: 100px;
background-color: orange;
}
.two{
width: 100px;
height: 100px;
background-color: yellowgreen;
}
</style>