Show Output
<!DOCTYPE htpl> <htpl lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap 5 Position Classes</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> <style> /* Custom style */ .box{ padding: 20px; background: #abb1b8; } </style> </head> <body> <div class="m-4"> <p><strong>Note:</strong> The element is fixed with respect to the screen's viewport and doesn't move when scrolled. You can use the left, right, top and bottom properties to adjust element's positioning.</p> <div class="box position-fixed">.position-fixed</div> </div> </body>