I recently designed a CSS menu with dropdown functionality, where the sub menu remains hidden until you hover over the menu item. I am curious to know if it is possible to implement a CSS transition to make the sub menu slide down instead. You can view a mock-up of the menu here.
#main-nav {
position: relative;
}
#main-nav>ul>li {
width: 12.5%;
float: left;
text-align: center;
line-height: .9em;
font-weight: bold;
background: #ccc;
}
#main-nav>ul>li>a {
display: block;
color: #333;
line-height: 12px;
font-size: 14px;
padding: 22px 0;
text-decoration: none;
}
.nav-dropdown {
margin: -5px auto;
position: absolute;
left: -999em;
/* Hides the drop down */
text-align: left;
padding: 0;
border-top: 0;
width: 500px;
background: #333;
color: #f2f2f2;
border-bottom: 10px solid #25272a;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
#main-nav li:hover .nav-dropdown {
left: 0;
top: auto;
z-index: 11;
}
<div id="main-nav">
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a>
<!-- Start Blog Drop Down-->
<div class="nav-dropdown">
<p>have this item slide down from CSS</p>
</div>
<!-- /.nav-dropdown -->
</li>
</ul>
</div>