By default, the progress bar displays text inside the portion that has progress. To ensure the text does not wrap prematurely, use
white-space: nowrap;
How can the issue of long text within a
div
be resolved without using JavaScript? Is there a way to make the text wrap onto a new line without cutting off any content?
.my-case {
width: 100px;
background-color: black !important;
}
.fix {
white-space: nowrap;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
Default
<div class="progress" style="width:100px">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">Some very very long text</div>
</div>
My case
<div class="progress my-case">
<div class="progress-bar fix" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">Some very very long text</div>
</div>