css实现圆形中居中显示文字核心点 line-height
css画一个实心圆,并在圆中居中显示一行标题画圆:这里需要注意 border-radius:50%
居中显示文字:此处需要令 line-height 值等于 height ,并设置 text-align:center
<view class='circle-text'>
{{yizuotu}}
</view>
</view>
.circle{
width: 360rpx;
height: 360rpx;
margin-top: 180rpx;
border-radius: 50%;
background-color: #1E90FF;
}
.circle-text{
width: 360rpx;
height: 360rpx;
line-height: 360rpx;
text-align: center;
font-size: 56rpx;
color: #ffffff;
}