1、用伪元素给边框
.usee{
width:120rpx;
height:120rpx;
border-radius: 50%;
box-sizing: border-box;
position: relative;
z-index: -1;
}
.usee::before{
content: '';
display: block;
width:120rpx;
height: 120rpx;
border:1px solid red;
box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
border-radius: 50%;
z-index: 100;
}
2、圆角度数给100%
style='border-radius:100%;border:1px solid red;width:120rpx;height:120rpx'
3、用背景色实现
.div {
position: relative;
width: 100rpx;
height: 100rpx;
padding: 4rpx;
border-radius: 50%;
background-color: red;
}
.img {
float: left;
width: 100%;
height: 100%;
border-radius: 50%;
}
本文介绍了三种实现圆形边框的方法:使用伪元素、直接设置圆角度数为100%以及利用背景色来达到效果。每种方法都附带了具体的代码示例。
1247

被折叠的 条评论
为什么被折叠?



