我需要构建一个包含 5 个选项的菜单,单击某个选项后会出现一个新的子菜单。我完全不知道该怎么做。
/**Navigation */
nav {
border: 1px solid red;
float: left;
margin-right: 35px;
min-height: 280px;
}
nav li {
text-decoration: none;
font-weight: normal;
color: red;
list-style: none;
}
/**Content */
#section {
background-color: ;
border: 1px solid;
font: normal 12px Helvetica, Arial, sans-serif;
margin-left: 180px;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
<div class="clearfix"></div>
<nav>
<ul>
<li><a href="index.html" accesskey="1"> Home </a> </li>
<li><a href="Portfolio.html" accesskey="2"> Portfolio </a> </li>
<ul>
<li><a href="Commercial.html">Commercial</a> </li>
<li><a href="Residential.html">Residential</a> </li>
<li><a href="heritage.html">Heritage</a> </li>
<li><a href="Rennovations.html">Rennovations</a> </li>
</ul>
<li><a href="services.html" accesskey="3"> Services </a> </li>
<li><a href="aboutus.html" accesskey="4"> About Us </a> </li>
<li><a href="contactus.html" accesskey="5"> Contact Us </a> </li>
</ul>
</nav>