- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>Bootstrap 4 Display Block Classes</title>
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/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/[email protected]/dist/umd/popper.min.js"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
- <style>
- .bs-example{
- margin: 20px;
- }
- .bs-example span{
- padding: 15px;
- margin-bottom: 10px;
- }
- </style>
- </head>
- <body>
- <div class="bs-example">
- <h2>Display Block Classes</h2>
- <p>Use the d-block class to create a block element. Add breakpoints (sm, md, lg, xl) to the classes (d-*-block) to control when the element should be a block element based on the screen width. Resize the browser window to see how it works.</p>
- <span class="d-block bg-primary">d-block</span>
- <span class="d-sm-block bg-success">d-sm-block</span>
- <span class="d-md-block bg-danger">d-md-block</span>
- <span class="d-lg-block bg-warning">d-lg-block</span>
- <span class="d-xl-block bg-info">d-xl-block</span>
- </div>
- </body>
- </html>