<div className="color-container">
<div className="inline" id="red"></div>
<div className="inline" id="green"></div>
<div className="inline" id="yellow"></div>
<div className="inline" id="blue"></div>
</div>
CSS:
.color-container {
width: 100px;
height: 200px;
display: inline;
position: relative;
}
.inline {
display: inline;
}
#red {
height: 50px;
width: 50px;
background-color: red;
border-radius: 50% 0 0 0;
}
#yellow {
height: 50px;
width: 50px;
background-color: yellow;
border-radius: 0 50% 0 0;
}
#green {
height: 50px;
width: 50px;
background-color: green;
border-radius: 0 0 50% 0;
}
#blue {
height: 50px;
width: 50px;
background-color: blue;
border-radius: 0 0 0 50%;
}
然而没有显示,即使当我没有显示:在子内联的div元素和父我没有100px的宽度和200像素高度所以2 divs到底?
什么是你试图让,你可以附加所需结果的任何图像? –
[Circle div中的文本溢出]的可能重复(https://stackoverflow.com/questions/40624527/text-overflow-in-circle-div) – Se0ng11
您能共享一个预期的输出图像吗?你实际上在寻找什么。 –