Show Output
<!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 None 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; } .bs-example div{ padding: 15px; margin-bottom: 10px; } </style> </head> <body> <div class="bs-example"> <h2>Display None Classes</h2> <p>Use the d-none class to hide an element. Add breakpoints (sm, md, lg, xl) to the classes (d-*-none) to control when the element should be hidden based on the screen width. Resize the browser window to see how it works.</p> <div class="d-none bg-primary">d-none</div> <div class="d-sm-none bg-success">d-sm-none</div> <div class="d-md-none bg-danger">d-md-none</div> <div class="d-lg-none bg-warning">d-lg-none</div> <div class="d-xl-none bg-info">d-xl-none</div> </div> </body> </html>