Show Output
<!DOCTYPE htpl> <htpl lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Bootstrap 4 Position Classes</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <style> .bs-example{ margin: 20px; } .box{ padding: 20px; background: #abb1b8; } </style> </head> <body> <div class="bs-example"> <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>