我不得不在我的 CSS 中重新排列一些东西,现在我的下拉菜单不显示为块。下拉菜单是通过 jquery 制作的,但我知道代码是正确的。现在是html或css问题。我会发布css,如果需要html,请告诉我,我会添加它。
HTML:
<nav id="navigation">
<ul class="navList">
<li><a class="navLink" href="">Home</a></li>
<li id="navLink1"><a class="navLink" href="">Services</a></li>
<ul class="dropDown" id="dropDown1">
<li>Pricing</li>
<li>Examples</li>
<li>Additional Services</li>
</ul>
<li id="navLink2"><a class="navLink" href="">Info</a></li>
<ul class="dropDown" id="dropDown2">
<li>About Us</li>
<li>Our Portfolio</li>
</ul>
<li><a class="navLink" href="">FAQ's</a></li>
</ul>
</nav>
CSS:
#navigation{
width: 100%;
height: 50px;
padding-bottom: 0px;
}
.navList li{
list-style: none;
text-align: left;
display: inline;
float: left;
padding: 5px;
margin-right: 25px;
font-size: 20px;
border-radius: 15px;
}
.navList li:hover{
background-color: #3399FF;
}
.navLink{
text-decoration: none;
color: black;
text-shadow: 2px 2px 5px white;
}
.dropDown{
position: absolute;
z-index: 1;
background-color: rgba(46, 184, 230, .9);
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
padding: 0px;
border-left: 2px solid lightgray;
border-right: 2px solid lightgray;
}
.dropDown li{
list-style: none;
text-align: left;
padding: 5px;
}
.dropDown li:hover{
background-color: #3399FF;
}
#dropDown1{
top: 185px;
left: 272px;
display: none;
}
#dropDown2{
top: 185px;
left: 382px;
display: none;
}