所以我希望我的导航栏有一个悬停效果,所以当鼠标悬停在白色边框底部时,它会显示出来,但由于某些原因,它并没有这样做,而是将边框底部设置为白色,在其他情况下什么也不做,请帮助
nav{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
ul{
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
}
.logo{
margin-left: 35px;
font-weight: 600;
text-decoration: underline;
}
.logo:hover{
cursor: pointer;
}
li,a{
list-style: none;
text-decoration: none;
margin-right: 4px;
}
button{
border-style: none;
border-radius: 30px;
background-color: white;
color: black;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 7px;
padding-right: 7px;
}
<nav>
<div class="logo">JEREMY/NDEBELE</div>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="#portfolio">My Work</a></li>
<li><a href="aboutme.html">About Me</a></li>
</ul>
<button class="nav-button"><a href="contactme.html">CONTACT ME</a></button>
</nav>
发布于 2021-03-10 19:01:08
好吧,我在任何地方都看不到这个悬停伪代码,只能在带有logo
类的div上看到,它显示为cursor: pointer;
如果您想要导航栏的悬停效果,则当悬停在白色边框底部时会显示
你只需要把导航栏选择器添加到它的边框::hover' then add the property
1px :hover' then add the property
`就这么简单。
https://stackoverflow.com/questions/66562702
复制相似问题