大家好,又见面了,我是你们的朋友全栈君。
外框高都为400px,边框为2px;圆的宽高为100px;中圆是水平居中;下圆是水平居中以及相对于中圆垂直居中(下圆到中圆的距离和下圆到下边框的距离相等)。效果如图:
我的实现方法是笨办法,大佬们多指点
<div class="box">
<div class="item">
<div class="child">
</div>
</div>
</div>
.box{
width: 400px;
height: 400px;
border: olive solid 2px;
display: flex;
justify-content: center;
align-items: center;
}
.item{
width: 100px;
height: 100px;
background-color: rgba(255, 0, 0, 0.6);
border-radius: 100%;
}
.child{
width: 100px;
height: 100px;
background-color: rgba(255, 0, 0, 0.6);
border-radius: 100%;
margin-top: 125px;
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/131250.html原文链接:https://javaforall.cn