I am attempting to utilize a Bootstrap progress bar to display text on it. The progress bar itself functions properly, but the text is not centered in the entire progress bar; rather, it is centered within the gray area. As the progress bar fills up, the text shifts to the right. How can I ensure that the text remains centered? This is how I am currently implementing it:
<div class="progress" style="height: 30px">
<div
id="theprogressbar"
class="progress-bar progress-bar-striped bg-success"
role="progressbar"
style="width: 0%; transition: none"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
></div>
<div id="theprogressbartext" class="d-flex justify-content-center align-items-center h-100 w-100">0/0</div>
</div>
When updating the text, I follow this approach:
function setProgressBar(percent, text) {
$("#theprogressbar").attr("style", "width:" + percent + "%");
$("#theprogressbar").attr("aria-valuenow", percent);
$("#theprogressbartext").html(text);
}
Could someone point out what I might be doing incorrectly in this setup? I am using Bootstrap from the CDN:
https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13717c7c67606761726353263d233d21">[email protected]</a>/dist/js/bootstrap.bundle.min.js