I'm having trouble creating a drop-down navigation menu using HTML and CSS. When I add the drop-down list, my menu extends onto two lines instead of one, and the drop-down menu doesn't appear when hovering. Here is a link to the jsfiddle for reference: https://jsfiddle.net/qbwyLzqj/
I can't seem to figure out where I went wrong.
.menu li {
padding: 10px;
}
.navigation {
width: 80%;
margin: 0 auto;
}
.menu {
display: inline-block;
width: 70%;
text-align: center;
}
.menu a {
text-decoration: none;
color: black;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 11px;
}
#menu-item-1,
#menu-item-2,
#menu-item-3,
#menu-item-4,
#menu-item-5,
#menu-item-6 {
display: inline-block;
}
.menu li {
padding: 10px;
}
.menu li a:hover {
color: grey;
}
.sub-menu-2 li {
display: none;
}
.menu li:hover .sub-menu-2 li {
display: block;
}
<nav class="navigation">
<ul class="menu">
<li id="menu-item-1"><a href="#">Portfolio</a></li>
<li id="menu-item-2"><a href="#">More Info</a></li>
<ul class="sub-menu-2">
<li id="sub-menu-item-2-1"><a href="#">About Me</a></li>
<li id="sub-menu-item-2-2"><a href="#">Work</a></li>
<li id="sub-menu-item-2-3"><a href="#">Services</a></li>
<li id="sub-menu-item-2-4"><a href="#">FAQ</a></li>
</ul>
<li id="menu-item-3"><a href="#">Designs</a></li>
<li id="menu-item-4"><a href="#">Shop</a></li>
<li id="menu-item-5"><a href="#">Blog</a></li>
<li id="menu-item-6"><a href="#">Contact</a></li>
</ul>
</nav>