Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap 5 Display Inline 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> .bs-example{ margin: 20px; } .bs-example div{ padding: 15px; margin-bottom: 10px; } </style> </head> <body> <div class="bs-example"> <h2>Display Inline Classes</h2> <p>Use the d-inline class to create a inline element. Add breakpoints (sm, md, lg, xl, and xxl) to the classes (d-*-inline) to control when the element should be a inline element based on the screen width. Resize the browser window to see how it works.</p> <div class="d-inline bg-primary">d-inline</div> <div class="d-sm-inline bg-success">d-sm-inline</div> <div class="d-md-inline bg-danger">d-md-inline</div> <div class="d-lg-inline bg-warning">d-lg-inline</div> <div class="d-xl-inline bg-info">d-xl-inline</div> </div> </body> </html>