gpt4 book ai didi

html - 如何调整下拉菜单的高度 - CSS

转载 作者:太空宇宙 更新时间:2023-11-04 10:55:31 26 4
gpt4 key购买 nike

我正在尝试使用 css 调整下拉菜单的大小,但我的 css 有问题。我需要调整高度以使其看起来正常。请看截图。这是我的 CSS:

ul#nav {
font-family: 'Lato', sans-serif;
background: #ffffff;
list-style: none;
line-height: 40px;
}

ul#nav li {
display: inline-block;
position: relative;
z-index: 8;
}

ul#nav li:hover {
color: #000000;
background: #ffffff;
}

ul#nav li a {
font-size: 14px;
font-weight: normal;
color: #444444;
height: 40px;
display: block;
padding: 0 15px;
text-transform: uppercase;
letter-spacing: 1px;
line-height: 40px;
}

ul#nav li a:hover {
background: #ffffff;
color: #000000;
text-decoration: none;
}

ul#nav li ul{
display: none;
float: left;
position: absolute;
top: 34;
left: 0;
z-index: 5;
margin: 0;
padding: 0;
border: 1px solid #eeeeee;
}

ul#nav li ul:before {
content: '';
display: block;
position: absolute;
left: 50%;
border-color: transparent transparent #eeeeee transparent;
border-style: solid;
border-width: 8px;
margin-left: -8px;
bottom: 100%;
width: 0;
height: 0;
}


ul#nav li:hover ul{
display: block;
background: #ffffff;
}

ul#nav li ul li{
background: #ffffff;
color: #000000;
min-width: 150px;
width: 100%:
white-space: nowrap;
float: left;
text-align: left;
}


ul#nav li ul li:hover {
background: #ffffff;
}

ul#nav li ul li a:hover {
color: #000000;
background: #ffffff;
}

ul#nav li ul li a{
text-align: left;
padding-left: 10px;
color: #000000;
text-transform none! important;
}

我正在尝试调整大小: http://imgur.com/lyLTxvD

最佳答案

height 属性添加到您的 ul#nav li ul 选择器。

像这样:

ul#nav li ul{
display: none;
float: left;
position: absolute;
height:200px;/*Note the change here. Edit the px to whatever you need */
top: 34;
left: 0;
z-index: 5;
margin: 0;
padding: 0;
border: 1px solid #eeeeee;
}

希望这对您有所帮助!

关于html - 如何调整下拉菜单的高度 - CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34665730/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com