在CSS中,如何将一个块元素往上移动?下面是一些方法。首先,让我们创建一个DIV块元素并添加CSS样式。<div class= box ></div&
<div class="box"></div> .box{ width: 100px; height: 100px; background-color: red; }
.box{ width: 100px; height: 100px; background-color: red; margin-top: -50px; }
.box{ width: 100px; height: 100px; background-color: red; position: relative; top: -50px; }
粉丝
0
关注
0
收藏
0