18910140161

如何在进度栏中放置文本?

顺晟科技

2021-08-19 11:48:01

37

我想将文本放在以下进度条的中间:

<progress align="left" class="turnbox2 turnbar" id="myturn"></progress>

我希望文本显示进度条的值。


顺晟科技:

您可以在CSS中使用before

#myturn{ height:30px; width:300px; background-color:orange; position:relative; } #myturn::before{ position:absolute; height:30px; background:green; content:'Custom text or 70%';//add your text top:0; left:0; width:70%; display:flex; color:white; align-items:center; justify-content:flex-end; padding-right:10px; }

<progress align="left" class="turnbox2 turnbar" id="myturn"></progress>

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航