/* 使用 border-radius 属性可以将边框变成圆弧形状 */
/* 示例代码: */
.box {
width: 200px;
height: 200px;
background-color: lightblue;
border: 5px solid black;
border-radius: 50%; /* 将元素变成圆形 */
}
/* 如果需要部分圆角,可以指定不同的值 */
.partial-rounded-box {
width: 200px;
height: 100px;
background-color: lightgreen;
border: 3px solid darkgreen;
border-radius: 20px; /* 四个角的圆角半径都为 20px */
}
/* 还可以分别为每个角设置不同的圆角半径 */
.custom-rounded-box {
width: 200px;
height: 100px;
background-color: lightcoral;
border: 3px solid darkred;
border-radius: 20px 50px 80px 10px; /* 依次为左上、右上、右下、左下的圆角半径 */
}
border-radius
属性用于设置元素的圆角边框。border-radius
的值为 50%
时,元素会变成一个圆形(前提是宽高相等)。border-radius
设置具体的像素值,如 20px
。border-radius
提供四个值来分别为每个角设置不同的圆角半径。上一篇:css高度
下一篇:css文字怎么居中在正中间
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站