- <!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 Flex 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;
- }
- </style>
- </head>
- <body>
- <div class="bs-example">
- <h2>Display Flex Classes</h2>
- <p>Use the d-flex class to create a flex container and transform direct children into flex items. You can also add breakpoints (sm, md, lg, xl) to the classes (d-*-flex) to control when the element should be a flex container based on the screen width.</p>
- <div class="d-flex bg-dark p-3">
- <div class="p-2 bg-success">Flex item 1</div>
- <div class="p-2 bg-warning">Flex item 2</div>
- <div class="p-2 bg-danger">Flex item 3</div>
- </div>
- </div>
- </body>
- </html>