gpt4 book ai didi

CSS 下拉菜单建议

转载 作者:行者123 更新时间:2023-11-28 05:54:10 25 4
gpt4 key购买 nike

您好,我正在尝试更改我网站上的下拉菜单,使其直接下拉到链接下方,并且还显示(当悬停时)二级类别到侧面而不是垂直

这是代码

/**
* Wide drop-down menu
*/



/* 1st level only
-------------------------------------------------------------- */
#nav > li:hover > a { position: relative; z-index: 1; /* Pull up above drop-down box */ }

/* 2nd level only
-------------------------------------------------------------- */
/* 2nd-level links block: with subcategory title and a list of child categories */
#nav ul.level0 > li {
display:inline-block;
float:none;
vertical-align:top;
padding-top:0;
padding-bottom:15px;
}
#nav ul.level0 > li > a {
margin-bottom:10px;
font-size:16px;
line-height:18px;
}

/* 2nd level+
-------------------------------------------------------------- */
#nav ul li { /*float:none;*/ margin-bottom:1px; }
#nav ul li a { float:none; }

/* 3rd level only
-------------------------------------------------------------- */
#nav ul.level1 { position:static; }
#nav ul.level1 > li {
float:none;
background:url(../../../images/infortis/ultra-megamenu/bullet.png) 3px 6px no-repeat;
padding-left:15px;
transition: background-position 150ms ease-out;
-moz-transition: background-position 150ms ease-out;
-webkit-transition: background-position 150ms ease-out;
-o-transition: background-position 150ms ease-out;
}
#nav ul.level1 > li:hover { background-position:6px 6px; }

/* 4th level
-------------------------------------------------------------- */
#nav ul.level2 { margin:7px 0; padding:0; position:static; }
#nav ul.level2 a { font-size:0.9166em; line-height:1.2727em; /*11px 14px*/ opacity:0.6; }
#nav li.level2:hover ul.level2 a {
opacity:1;
transition: opacity 150ms ease-out;
-moz-transition: opacity 150ms ease-out;
-webkit-transition: opacity 150ms ease-out;
-o-transition: opacity 150ms ease-out;
}

/* 4rd level+
-------------------------------------------------------------- */
#nav ul ul ul li { background:none; padding-left:0; }

任何帮助将不胜感激

最佳答案

很难通过您提供的代码了解您想要什么,但如果您给下拉菜单一个绝对位置,它应该直接出现在它所在的列表项下方。

关于CSS 下拉菜单建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37148090/

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