Candy Dropdown - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Candy Dropdown</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(to right, #ff9a9e, #fecfef); color: #fff; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .dropdown { position: relative; display: inline-block; } .dropdown-btn { background-color: #ff6f61; color: #fff; padding: 15px 30px; font-size: 18px; border: none; cursor: pointer; transition: background-color 0.3s ease; display: flex; align-items: center; } .dropdown-btn:hover { background-color: #ff4f41; } .dropdown-btn .icon { margin-left: 10px; transition: transform 0.3s ease; } .dropdown-content { display: none; position: absolute; background-color: #fff; color: #333; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); overflow: hidden; z-index: 1; width: 214px; } .dropdown-content a { color: #333; padding: 12px 16px; text-decoration: none; display: block; transition: background-color 0.3s ease, color 0.3s ease; } .dropdown-content a:hover { background-color: #ff6f61; color: #fff; } .dropdown-content .icon { margin-right: 10px; } .dropdown:hover .dropdown-content { display: block; animation: fadeIn 0.5s; } .dropdown:hover .dropdown-btn .icon { transform: rotate(180deg); } @keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } </style> </head> <body> <div class="dropdown"> <button class="dropdown-btn"> Candy Options <span class="icon">🍬</span> </button> <div class="dropdown-content"> <a href="#"><span class="icon">🍭</span>Lollipop</a> <a href="#"><span class="icon">🍫</span>Chocolate</a> <a href="#"><span class="icon">🍩</span>Donut</a> <a href="#"><span class="icon">🍪</span>Cookie</a> </div> </div> </body> </html>