Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put text under a spinner bootstrap

I am using bootstrap 4.3 spinner, all working well but i want to put additional text under the spinner. Here is my HTML

<div class="d-flex justify-content-center">
       <div class="row">
           <div class="spinner-border" role="status">
               <span class="sr-only">Loading...</span>
            </div>
         </div>
        <div class="row">
            <strong>Collecting data</strong>
        </div>
                            
    </div>

But the text "collecting data" is appending on the spinner, how can i fix this?

like image 715
Matius Nugroho Aryanto Avatar asked Sep 19 '25 07:09

Matius Nugroho Aryanto


1 Answers

Add these two classes to the container div:

flex-column align-items-center

flex-column makes the flexbox stack vertically and align-items-center centers the items on the new axis.

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="d-flex flex-column align-items-center justify-content-center">
   <div class="row">
       <div class="spinner-border" role="status">
           <span class="sr-only">Loading...</span>
       </div>
    </div>
    <div class="row">
      <strong>Collecting data</strong>
    </div>
</div>
like image 157
BugsArePeopleToo Avatar answered Sep 20 '25 23:09

BugsArePeopleToo