Hey everyone, I've got a Mega Menu below for you to check out!
<div id="menu-wrapper">
<ul class="nav">
<li><a href='#'>Brands</a>
<div>
<div class="nav-column">
<ul><li><a href="index.php?brands=1">Siemens</a></li>
<li><a href="index.php?brands=2">KSB</a></li>
<li><a href="index.php?brands=3">Dadex</a></li>
<li><a href="index.php?brands=4">Hyundai</a></li>
</ul>
</div>
</div>
</li>
<li><a href='#'>Products</a>
<div>
<div class="nav-column">
<h3>Automation</h3>
<ul>
<li><a href="index.php?stypes=1">Logo!</a></li>
<li><a href="index.php?stypes=2">Simatic-S7-200</a></li>
<li><a href="index.php?stypes=3">Simatic-S7-400</a></li>
<li><a href="index.php?stypes=4">Simatic-S7-1200</a></li>
<li><a href="index.php?stypes=5">HMI</a></li></ul>
</div>
<div class="nav-column">
<h3>Pumps</h3>
<ul>
<li><a href="index.php?products=7">Etanorm</a></li>
<li><a href="index.php?products=8">KWP</a></li>
<li><a href="index.php?products=9">ZORO</a></li>
<li><a href="index.php?products=10">DWT</a></li>
</ul>
</div>
</li>
<li><a href="#">About ME</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Contact US</a></li>
</ul>
The code above comes with the following CSS and media queries:
/* Reset */
.nav,.nav a,.nav ul,.nav li,.nav div {margin: 0;padding: 0;border: none;outline: none;}
.nav a { text-decoration: none; }
.nav li { list-style: none; }
/* Menu Container */
#menu-wrapper{border:0px solid #000;width:870px;margin:10px 0px 0px 380px;}
.nav { display: inline-block;position: relative; margin:30px 0px 0 0px;cursor:
default;z-index: 500;border:0px solid #000;}
/* Menu List */
.nav > li {display: block;float: left;background:#efefef;}
/* Menu Links */
.nav > li > a {position: relative; display: block; z-index: 510;height: 54px;padding:
0 20px;line-height: 54px; font-size: 14px;}
.nav > li:hover > a { background: #c8c8c8; }
.nav > li:first-child > a {border-radius: 3px 0 0 3px; border-left: none;}
/* Menu Dropdown */
.nav > li > div {position: absolute;display: block; width: 100%;top: 50px;left: 0;
opacity: 0; display:none;overflow: hidden;background:#efefef;}
.nav > li:hover > div { opacity: 1; display: block;overflow:
visible;border:1px solid #000;}
/* Menu Content Styles */
.nav .nav-column {float: left;width: 20%;padding: 2.5%; border-right: 1px dotted
#c8c8c8;}
.nav .nav-column h3 { margin: 20px 0 10px 0; line-height: 18px;
font-weight: bold;font-size: 14px; text-transform: uppercase;}
.nav .nav-column li a { display: block; line-height: 26px;font-weight: bold;
font-size: 13px;}
.nav .nav-column li a:hover { color: #666666; }
@media screen and (max-width: 480px) {
#menu-wrapper { float: none;margin:0px 0px 0px 0px; width: 100%;}
.nav{display: block;margin:0px 0px 0 0px;cursor: default;border:0px solid
#000;padding:0px 0px 0px 0px;}
.nav>li {background: #efefef;display: block;margin:0px 0px 0px
0px;float:none;width:100%;padding:0px 0px 0px 0px;}
.nav >li>a {display: block;padding:0px 0px 0px 0px;text-align: center;margin:0px
0px 0px 0px;}
.nav .nav-column h3 { margin: 20px 0 10px 0; line-height: 18px;
font-weight: bold;font-size: 10px; text-transform: uppercase;}
.nav .nav-column li a { display: block; line-height: 26px;font-weight: bold;
font-size: 9px;}
.nav >li:hover > div{display: block;z-index:999;}
}
If you visit , when you resize the browser window to its smallest size and hover on the menu links, you'll notice that the dropdown menu div overlaps with the rest of the menu. What I'm aiming for is to have the rest of the menu expand vertically when a user hovers over "Brands" or "Products", similar to the effect on . I've been trying to achieve this but currently feeling a bit lost as nothing seems to be happening.
Cheers,
Tapos