/* 使用 top 属性进行定位 */
.box {
position: relative; /* 必须先设置 position 属性为 relative, absolute 或 fixed */
top: 20px; /* 向下移动 20px */
}
/* 解释说明:
1. `position: relative;` 表示元素相对于其正常位置进行定位。
2. `top: 20px;` 表示元素在垂直方向上向下移动 20px。
3. 如果要使 `top` 属性生效,必须先设置 `position` 属性为 `relative`、`absolute` 或 `fixed`。
*/
上一篇:css内联样式
下一篇:css sprites
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站