简体   繁体   English

ProgressBar.js 的圆圈内的文本不会在我的 CSS 网格单元格内正确居中

[英]The text inside the circle from ProgressBar.js won't center correctly inside my CSS Grid cell

Full working code here.完整的工作代码在这里。

https://codepen.io/chen-luke/pen/gOweWKE https://codepen.io/chen-luke/pen/gOweWKE

My CSS grid is made up of two columns我的 CSS 网格由两列组成

    .grid-template-areas:
        "name name"
        "rate diff_rate"
        "ratePie w-t-a"
        "help help"
        ". r-link";

Inside my ratePie cell is where I put my progress circle.在我的 ratePie 单元中,我放置了我的进度圈。 The circle would display correctly, but the text "4/5" from the circle will not.圆圈会正确显示,但圆圈中的文本“4/5”不会。 What can I do to align the text in the center of the circle?我该怎么做才能将文本对齐在圆圈的中心?

Remove autoStyleContainer: false from the text: configuration parameter.text:配置参数中删除autoStyleContainer: false Alternatively, remove the entire text: parameter since it becomes unused.或者,删除整个text:参数,因为它变得未使用。

By including that setting you are telling ProgressBar that you want to style the <p> tag yourself - which you never actually do.通过包含该设置,您告诉 ProgressBar 您想自己设置<p>标记的样式 - 您实际上从未这样做过。

The default text styles are designed to do exactly what you want.默认文本 styles 旨在完全满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM