gpt4 book ai didi

html - Superfish 二级 ul 非常小

转载 作者:行者123 更新时间:2023-11-28 11:13:45 26 4
gpt4 key购买 nike

问题是我网站上的 superfish 菜单: http://alexander-pastor.de/

当鼠标悬停在顶层的ul的li上时,子ul的高度只有16px。我无法以某种方式修复它。将 height/min-height css-property 添加到 ul 或 li 似乎不起作用。

我通过 jQuery 将类 sf-menu 添加到 ul,因为它是从 contao 模块自动生成的代码。它由导航元素包裹。像这样:

<nav class="mod_navigation block">
<ul class="level_1 sf-menu">
<li>
<ul>...
</li>
... ...
... ...
</ul>
</nav>

如果有人能研究一下,我将不胜感激:D

我使用的是最新版本的 superfish。我在 head-tag 中包含了以下内容:

<script type="text/javascript">


$(document).ready( function() {
$('#header-navigation ul.level_1').addClass('sf-menu');
});

$(document).ready(function(){

// initialise plugin
var example = $('#header-navigation ul.level_1').superfish({});

});

</script>

<script type="text/javascript" src="files/version9/plugins/superfish/superfish.js"> </script>
<script type="text/javascript" src="files/version9/plugins/superfish/hoverIntent.js"></script>

superfish.css 包含:

.sf-menu, .sf-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.sf-menu li {
position: relative;
min-height:40px;/*cust*/
line-height:1.0;
}
.sf-menu ul {
position: absolute;
display: none;
top: 100%;
left: 0;
z-index: 10000;
}
.sf-menu > li {
float: left;
}
.sf-menu li:hover > ul,
.sf-menu li.sfHover > ul {
display: block;
}

.sf-menu li:hover > ul,/*cust*/
.sf-menu li.sfHover > ul li{
display: block;
min-height:40px;
line-height:1.0;
}

.sf-menu a, .sf-menu span {
display: block;
position: relative;
padding:12px 16px;
}


.sf-menu {
float: left;
margin-bottom: 1em;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
.sf-menu ul {
box-shadow: 2px 2px 6px rgba(0,0,0,.2);
min-width: 12em; /* allow long menu items to determine submenu width */
*width: 12em; /* no auto sub width for IE7, see white-space comment below */
}

.sf-menu a {
color: #13a;
}
.sf-menu li {
background: rgb(16, 16, 16);
background: rgba(16, 16, 16, 1);
white-space: nowrap; /* no need for Supersubs plugin */
*white-space: normal; /* ...unless you support IE7 (let it wrap) */
-webkit-transition: background .2s;
transition: background .2s;
}
.sf-menu ul li {
background: rgb(60, 60, 60);
background: rgba(60, 60, 60, 0.8);
}
.sf-menu li.first{
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
}
.sf-menu ul ul li {
background: rgb(51, 51, 51);
background: rgba(51, 51, 51, 0.8);
height:40px;
}
.sf-menu ul ul ul li {
background: rgb(34, 34, 34);
background: rgba(34, 34, 34, 0.8);
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
background:rgb(40,40,40);
outline:0;
text-shadow:
-1px -1px 3px #fff,
-1px -1px 4px #fff;
text-decoration:none;
}

.sf-menu li:hover,
.sf-menu li.sfHover {
background: rgb(40, 40, 40);
background: rgba(40, 40, 40, 0.8);
/* only transition out, not in */
-webkit-transition: none;
transition: none;
}

/*** arrows (for all except IE7) **/
.sf-arrows .sf-with-ul {
padding-right: 2.5em;
*padding-right: 1em; /* no CSS arrows for IE7 (lack pseudo-elements) */
}
/* styling for both css and generated arrows */
.sf-arrows .sf-with-ul:after {
content: '';
position: absolute;
top: 50%;
right: 1em;
margin-top: -3px;
height: 0;
width: 0;
/* order of following 3 rules important for fallbacks to work */
border: 5px solid transparent;
border-top-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
border-top-color: rgba(255,255,255,.5);
}
.sf-arrows > li > .sf-with-ul:focus:after,
.sf-arrows > li:hover > .sf-with-ul:after,
.sf-arrows > .sfHover > .sf-with-ul:after {
border-top-color: white; /* IE8 fallback colour */
}
/* styling for right-facing arrows */
.sf-arrows ul .sf-with-ul:after {
margin-top: -5px;
margin-right: -3px;
border-color: transparent;
border-left-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
border-left-color: rgba(255,255,255,.5);
}
.sf-arrows ul li > .sf-with-ul:focus:after,
.sf-arrows ul li:hover > .sf-with-ul:after,
.sf-arrows ul .sfHover > .sf-with-ul:after {
border-left-color: white;
}

应该不会和我的default.css冲突吧?!

default.css - 包含#header**

的部分
#header {
border-radius:...;

color:#fff;
}

#header a{
color:#fff;
text-decoration:none;
}

#header-menu{
width:1000px;
height:46px;

background: ...;

text-align: center;

border-radius...
}

#header-menu-elements{
margin:5px 0;
}

#header-menu-elements{
height:36px;
float:left;
background:transparent;
}

#header-navigation{
height:40px;
background:...;
border-radius:...;
}

最佳答案

这不是因为高度属性。你的 .block 有一个 overflow: hidden; (也在你的 nav 上),这导致你的子导航的主要部分不是可见。

关于html - Superfish 二级 ul 非常小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21856579/

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