You can just change the style="width: 100%"
to whatever % you want, this is not the % of the bar but the width of the inner blue bar. It seems like you are using Bootstrap. You can read about this progress bar here: https://getbootstrap.com/docs/5.1/components/progress/
You can also give aria
attributes to your bar, which you can give a min and max value. (also seen in the link above)
For example: aria-valuenow="0" aria-valuemin="0" aria-valuemax="10"
.progress{
width: 300px;
margin: 20px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<div class="progress">
<div id="test" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 75%"></div>
</div>
Example with the aria
values (copied from the Bootstrap docs):
.progress{
margin: 20px;
width: 300px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 20%" aria-valuenow="2" aria-valuemin="0" aria-valuemax="10"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 40%" aria-valuenow="4" aria-valuemin="0" aria-valuemax="10"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 60%" aria-valuenow="6" aria-valuemin="0" aria-valuemax="10"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 80%" aria-valuenow="8" aria-valuemin="0" aria-valuemax="10"></div>
</div>