问题是我网站上的超级鱼菜单: http://alexander-pastor.de/
将鼠标悬停在顶级ul的li上时,子ul的高度仅为16px。我无法以某种方式解决它。将高度/最小高度css-property添加到ul或li似乎不起作用。
我通过jQuery将类sf-menu添加到ul,因为它是来自contao-module的自动生成的代码。它由nav元素包装。像这样:
<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>
.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不应该有冲突吗?!
#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:...;
}
答案 0 :(得分:0)
这不是因为身高属性。您的.block
有一个overflow: hidden;
(也在您的nav
上),这导致您的导航的主要部分不可见。