Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Adding Headers to Bootstrap Dropdowns</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> </head> <body> <div class="m-5"> <div class="btn-group"> <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">Products</button> <div class="dropdown-menu"> <div class="dropdown-header">ELECTRONICS</div> <a href="#" class="dropdown-item">Mobiles</a> <a href="#" class="dropdown-item">Tablets</a> <a href="#" class="dropdown-item">Laptops</a> <div class="dropdown-header">FASHION</div> <a href="#" class="dropdown-item">Clothing</a> <a href="#" class="dropdown-item">Sunglasses</a> </div> </div> </div> </body> </html>