我有一个导航,我想在我的两个导航列表项(左侧的前两个)中添加一个下拉菜单(悬停时)。最好的方法是什么?我尝试了Google的一些解决方案,但没有一个真正对我有用,这只是弄乱了我的导航。
这是我的导航:(展开至完整页面以查看导航功能)
ul li {
list-style: none;
}
html {
font-family: "Roboto", serif;
}
.navigation {
position: fixed;
width: 100%;
text-align: center;
font-size: 14px;
font-size: 0.875rem;
line-height: 1.5em;
height: 180px;
font-family: "Roboto", serif;
transition: all 0.5s ease;
display: flex;
justify-content: center;
align-items: center;
z-index: 99999;
background-color: rgba(175, 213, 123, 0.70);
}
.navigation ul {
display: flex;
flex-direction: row;
margin: 0;
padding: 0;
z-index: 1;
}
.navigation ul li {
float: left;
padding: 0 20px;
text-decoration: none;
text-transform: uppercase;
color: #222222;
margin: -12px 0;
letter-spacing: 0.200em;
transition: all 0.5s ease;
}
.navigation ul li:hover {
color: #ffa947;
cursor: pointer;
}
@media (min-width: 0) and (max-width: 770px) {
.navigation ul li {
margin: 17px 0;
}
}
.navigation ul li.reg {
font-size: 10px;
font-size: 0.625rem;
}
@media (min-width: 0) and (max-width: 770px) {
.navigation ul li.reg {
display: none;
}
}
.navigation ul li.title {
font-size: 24px;
font-size: 1.5rem;
}
.navigation h1 {
font-size: 24px;
font-size: 1.5rem;
color: #222222;
font-weight: 300;
z-index: 1;
margin: 0;
padding: 0;
letter-spacing: 10px;
}
@media (min-width: 0) and (max-width: 770px) {
.navigation {
flex-direction: column;
height: auto;
}
}
.navigation.sticky {
height: 55px;
background-color: rgba(175, 213, 123, 1);
}
.navigation.sticky::after {
opacity: 1;
filter: alpha(opacity=100);
}
.navigation.sticky ul li {
margin: 0;
}
@media (min-width: 0) and (max-width: 770px) {
.navigation.sticky {
height: auto;
}
.navigation.sticky .title {
margin: 17px 0;
}
}
.navigation .hidden {
visibility: hidden;
height: 0;
display: none;
}
阿晨1998
相关分类