Modern Green Mega Menu - 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>Modern Green Mega Menu</title> <style> body { font-family: 'Arial', sans-serif; margin: 0; padding: 0; background: #e0f7e0; } nav { background: #34a853; color: #fff; padding: 10px 0; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); } .menu-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; } .menu { display: flex; list-style: none; padding: 0; margin: 0; } .menu li { position: relative; margin: 0 15px; } .menu > li > a { text-decoration: none; color: #fff; padding: 10px 15px; display: block; transition: background 0.3s; } .menu > li:hover > a { background: #2e7d32; } .mega-menu { position: absolute; left: 0; top: 100%; background: #e8f5e9; color: #333; display: none; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); padding: 20px; z-index: 10; animation: fadeIn 0.5s ease-in-out; white-space: nowrap; } .menu > li:hover .mega-menu { display: flex; } .mega-menu-column { padding: 10px; } .mega-menu-column h4 { margin-top: 0; } .mega-menu-column a { display: block; text-decoration: none; color: #34a853; padding: 5px 0; transition: color 0.3s; } .mega-menu-column a:hover { color: #2e7d32; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } /* Custom emoji and icon styles */ .menu a::before { content: "🌿 "; } .mega-menu-column a::before { content: "🍀 "; } /* Responsive styles */ @media (max-width: 768px) { .menu-container { flex-direction: column; align-items: flex-start; } .menu { flex-direction: column; width: 100%; } .menu li { width: 100%; } .menu > li > a { width: 100%; } .mega-menu { position: static; width: 100%; } .mega-menu-column { width: 100%; } } </style> </head> <body> <nav> <div class="menu-container"> <ul class="menu"> <li> <a href="#">Home</a> </li> <li> <a href="#">Portfolio</a> <div class="mega-menu"> <div class="mega-menu-column"> <h4>Web Design</h4> <a href="#">Responsive Design</a> <a href="#">E-commerce</a> <a href="#">Portfolio Sites</a> </div> <div class="mega-menu-column"> <h4>Graphics</h4> <a href="#">Logos</a> <a href="#">Illustrations</a> <a href="#">Branding</a> </div> <div class="mega-menu-column"> <h4>Photography</h4> <a href="#">Nature</a> <a href="#">Urban</a> <a href="#">Events</a> </div> </div> </li> <li> <a href="#">Projects</a> <div class="mega-menu"> <div class="mega-menu-column"> <h4>Current</h4> <a href="#">Project A</a> <a href="#">Project B</a> <a href="#">Project C</a> </div> <div class="mega-menu-column"> <h4>Completed</h4> <a href="#">Project D</a> <a href="#">Project E</a> <a href="#">Project F</a> </div> <div class="mega-menu-column"> <h4>Upcoming</h4> <a href="#">Project G</a> <a href="#">Project H</a> <a href="#">Project I</a> </div> </div> </li> <li> <a href="#">Contact</a> </li> </ul> </div> </nav> </body> </html>