ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 5 Spinner Placement
Source Code
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"> <title>Bootstrap 5 Spinner Placement</title> <style type='text/css'> .custom-height { height: 100px; } </style> </head> <body> <div class="container"> <h1 class="text-center">Spinner Placement</h1> <p class="text-justify text-center">Flexbox utility classes are very helpful to place spinner within the web page.</p> <h2>Center Alignment</h2> <div class="d-flex justify-content-center bg-light custom-height"> <div class="spinner-border" role="status"> <span class="visually-hidden">Loading...</span> </div> </div> <h2>Vertically Center Alignment</h2> <div class="d-flex align-items-center bg-light custom-height"> <span class="visually-hidden">Loading...</span> <div class="spinner-border ml-auto" role="status" aria-hidden="true"></div> </div> </div> <!--/container--> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Output :
Running