我正在尝试创建一种圆并尝试嵌入一个内圆,但内圆未按照图像中的要求定位。
.outer-circle {
width: 200px;
height: 200px;
background-color: coral;
border-radius: 50% 50% 0 0;
transform: rotate(90deg);
}
.inner-circle {
width: 100px;
height: 100px;
margin-left: 10px;
margin-top: 10px;
background-color: blue;
border-radius: 50%;
}
<div class="outer-circle">
<div class="inner-circle"></div>
</div>
如何在不编写任何 Javascript 的情况下根据需要定位我的内圈。
最佳答案
以下作品:
.outer-circle {
width: 200px;
height: 200px;
background-color: coral;
border-radius: 50% 50% 0 0;
transform: rotate(90deg);
padding-top: 15px;
}
.inner-circle {
width: 160px;
height: 160px;
margin-left: 20px;
margin-top: 10px;
background-color: blue;
border-radius: 50%;
}
<div class="outer-circle">
<div class="inner-circle"></div>
</div>
关于html - 无法在我的外部 div 内对齐同心内圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47576429/