我想在圆圈内绘制文字,但如何将其与垂直中心对齐?
<div style="margin: 0px auto; border-radius: 100%; color: #09ab8d; border: 2px solid #09ab8d; width: 60px; height: 60px; font-weight: bold; font-size: 25px; text-align: center;">1</div>
我想在圆圈内绘制文字,但如何将其与垂直中心对齐?
<div style="margin: 0px auto; border-radius: 100%; color: #09ab8d; border: 2px solid #09ab8d; width: 60px; height: 60px; font-weight: bold; font-size: 25px; text-align: center;">1</div>
在问题中显示的情况下,您可以添加
line-height:60px使用
display: flex- 里面的文本将始终位于中心和中间,具体取决于父块的大小