几乎没有创建形状/这些语言的经验。
我创建了一个关于质量的调查,需要把文字圈成圆圈。
现在,我正在为简单的圆使用这个代码,将修改它以匹配第二个圆圈。
.circle
{
width:500px;
height:500px;
border-radius:250px;
font-size:50px;
color:#fff;
line-height:500px;
text-align:center;
background:#000
}<div class="circle">Text</div>
发布于 2022-01-20 18:50:21
我使用linear-gradient作为“背景”(中线),flex用于文本定位
.circle
{
display: flex;
flex-direction: column;
justify-content: space-evenly;
width: 200px;
height: 200px;
border-radius: 250px;
font-size: 30px;
color: black;
text-align: center;
background: #000;
border: solid black 1px;
background: linear-gradient(to top, white 49%, black 50%, white 50%),
linear-gradient(to bottom, white, black 60%, white 50%);
}<div class="circle">
<div>Text</div>
<div>Text</div>
</div>
.circle
{
position:relative;
display:flex;
flex-direction:column;
justify-content:space-evenly;
width:200px;
height:200px;
border-radius:50%;
font-size:30px;
color:black;
text-align:center;
background:#000;
border:solid black 1px;
background: white
}
.circle:after {
content:"";
width:100%;
background-color:black;
height:1px;
position:absolute;
top:50%;
}<div class="circle">
<div>Text</div>
<div>Text</div>
</div>
https://stackoverflow.com/questions/70791463
复制相似问题