Hi Guys,
I have a problem with regard to creating a dropdown main menu in CSS. I have already tried to change/add my code and checked other resources but it still doesn't work. I hope you guys will be able to help me. Many thanks.
Jacob
Here is my HTML code:
<nav>
<ul class="menu">
<li><a class="active" href="home.html">Home Page</a></li>
<li><a href="KB.html">Knowledgebase</a></li>
<ul>
<li><a href="#">POS</a></li>
<li><a href="#">Backoffice</a></li>
<li><a href="#">Simulator</a></li>
</ul>
<li><a href="CS.html">Case Scrub</a></li>
<li><a href="Team%20View.html">Team View</a></li>
<li><a href="News.html">News and Updates</a></li>
<li class="last-item"><a href="Forums.html">Forums</a></li>
</ul>
</nav>
Here is my CSS code:
/* main menu */
.menu {
width: 100%;
}
.menu li {
float: left;
position: relative;
margin-right: 1px;
}
.menu li.last-item {
margin: 0;
}
.menu li a {
display: inline-block;
width: 160px;
font-size: 17px;
line-height: 1.22em;
padding: 18px 0 36px;
margin-top: 10px;
color: #fff;
background: #000;
text-align: center;
border-radius: 18px 18px 0 0;
-moz-border-radius: 18px 18px 0 0;
-webkit-border-radius: 18px 18px 0 0;
}
.menu li a:hover {
color: #0f0f0f;
background: #fff;
padding: 28px 0 36px;
margin: 0;
}
.menu li a.active {
color: #0f0f0f;
background: #fff;
padding: 28px 0 36px;
margin: 0;
}