简体   繁体   中英

How to vertically align text in progress bar bootstrap

I decided to change height of the progress bar but the text doesnt seem to align vertically inside the progress bar.

here is the jsfiddle i made.

jsfiddle

<div class="container">
    <div class="progress" style="height:40px;">

  <div class="progress-bar progress-bar-success" style="width: 50%">
  </div>
  <div class="progress-bar progress-bar-warning" style="width: 27%">
   <span style="" id="spanP">60%</span>
  </div>

</div>
</div>

Change line-height of your span.

<div class="container">
    <div class="progress" style="height:40px;">

  <div class="progress-bar progress-bar-success" style="width: 50%">
  </div>
  <div class="progress-bar progress-bar-warning" style="width: 27%">
   <span style="line-height: 39px;" id="spanP">60%</span>
  </div>

</div>
</div>

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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