我在将垂直子菜单转换为水平子菜单时遇到了一些麻烦,我尝试的一切似乎都不正确,或者我最终改变了主菜单的其余部分。
HTML
<nav>
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="justjoelabout.html">ABOUT</a></li>
<li><a href='#'><span>WORK</span></a>
<ul>
<li class="services1">
<a href="justjoelprint.html">PRINT</a>
<a href="justjoelbranding.html">BRANDING</a>
<a href="justjoeleditorial.html">EDITORIAL</a>
<a href="justjoelphotography.html">PHOTOGRAPHY</a>
</ul>
</li>
<li><a href="justjoelblog.html">BLOG</a></li>
<li><a href="justjoelinspired.html">INSPIRED</a></li>
<li><a href="justjoelcontact.html">CONTACT</a></li>
</ul>
</nav>
这是CSS
nav {
height: 70px;
float: left;
font-size: 20px;
color: #00BCDC;
font-family: "geogtq md";
}
nav ul {
list-style-type: none;
color: #00BBE4;
font-family: "geogtq md";
float: left;
display:inline;
}
nav li {
float: left;
margin-right: 20px;
color: #00BBE4;
font-family: "geogtq md";
margin-left: auto;
display: inline;
}
a:link {
text-decoration: none;
color: #00C0EE;
font-family: "geogtq md";
}
a:visited {
text-decoration: none;
color: #00C0EE;
}
a:hover {
text-decoration: none;
color: #007889;
}
a:active {
text-decoration: none;
color: #00C0EE;
}
ul {
font-family: "geogtq md";
font-size: 20px;
margin: 0;
padding: 0;
list-style: none;
}
ul li {
display: inline;
position: relative;
float: left;
}
li ul {
display: none;
}
ul li a {
text-decoration: none;
margin-right:5px;
white-space: nowrap;
color:#066;
}
li:hover ul {
display: inline;
position: absolute;
}
li:hover li {
float: none;
font-size: 16px;
font-weight:bold;
margin-top:3px;
}
.services1 a {
color:#00C0EE;
float: left;
list-style-type: none;
display:inline;
}
任何帮助将不胜感激,因为这已经持续了一段时间,并且会帮助我的网站上的东西如何,谢谢