我创建了一个圆形,在其中显示一些百分比。我想把多个项目放在一行中。
我试过使用div和make display flex,但没有任何东西能正常工作。以下是我到目前为止尝试的:
.meal-circular-progress{
position: relative;
height: 100px;
width: 100px;
border-radius: 50%;
background: conic-gradient(#7d2ae8 0deg, #ededed 0deg);
display: flex;
align-items: center;
justify-content: center;
margin:auto;
//transition: background 2s;
//transition-timing-function: ease;
//border: 1px solid red;
}
.meal-circular-progress::before{
content: "";
position: absolute;
height: 80px;
width: 80px;
border-radius: 50%;
background-color: #fff;
//border: 1px solid red;
}
.progress-value{
position: relative;
font-size: 40px;
font-weight: 600;
color: #7d2ae8;
}
<div class="col-sm-6 center">
<div class="meal-circular-progress" ng-style="c.circular">
<span class="progress-value">10%</span>
</div>
<div class="meal-circular-progress" ng-style="c.circular">
<span class="progress-value">10%</span>
</div>
<div class="meal-circular-progress" ng-style="c.circular">
<span class="progress-value">10%</span>
</div>
</div>
2条答案
按热度按时间nmpmafwu1#
你需要使你的父元素为
flexbox
,在本例中你的父元素为center
。将该元素设置为
flexbox
,并使用align-items
属性执行此操作:y3bcpkx12#
弯曲容器
https://codepen.io/mplungjan/pen/xxJEPwx