- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
问题是我网站上的 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>
.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:...;
}
最佳答案
这不是因为高度属性。你的 .block
有一个 overflow: hidden;
(也在你的 nav
上),这导致你的子导航的主要部分不是可见。
关于html - Superfish 二级 ul 非常小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21856579/
我正在尝试使用 jQuery 来提交一个基本的 Accordion 样式菜单。 这是菜单: http://www.cybart.com/bscg/ 这是为其提供 Accordion 功能的代码片段:
这是我的网站: http://www.simply-a-christian.com/index.html 在导航栏上,如果您移动到: 信念 玛丽安教义 您可以看到每个 Marian Dogma(列出了
这可能是一个很容易回答的问题,但是,我找不到解决方案。我已经建立了一个非常简单的菜单,每当我将鼠标悬停在 ul 父项上时,它的子项 ul ul 就会变得可见。基本上它是有效的,但 parent 让位于
这是一张图片: 问题是(你可以看到):“页面”按钮太低,无法点击。我想要的是它应该靠近“联系人”。 现在是代码: HTML Home About
我有一个这样的嵌套 ul 列表: Subcat Subcat2
如果标题不好理解,我来解释一下... 我有一个 css/jquery 切换菜单。按“+”号时它变大,按“-”号时它变小。我使几个元素的填充、边距和高度在切换/单击时发生变化。菜单顶部充满了链接,然后当
我正在尝试创建一个列表,该列表会在单击上/下时更改它的第一个元素。 This is what i want to do. 此代码运行良好。但问题是我也在我网站的主菜单中使用列表,并且这段代码也在我的主
我需要使用水平缩放的 ul > li > ul 的组合来创建一个菜单。每个 ul 都应该有一个 max-height 并在溢出时滚动。悬停在 li 上时,如果里面有另一个 ul 标签,它应该会在右侧打
我正在 ul 中编写 ul 来制作 Accordion 式菜单。但是当我在 html 验证器中检查下面的代码时,它给了我这些错误 Element ul not allowed as child of
我有两个列表,第二个列表是可排序的,我可以从第一个列表拖动到第二个列表,但不知道如何从第一个列表中删除。 如果我删除 helper: "clone" ,该项目 (li) 会被删除,但拖放操作效果不佳(
JSFiddle 问题:https://jsfiddle.net/td6szj3o/ /我有一个 ul li,每个 li 都有标准文本项。该列表是动态的,因此有时每个内容 li 小于其所在容器的 wi
我有两个元素 - 一个在另一个里面。问题是第二个元素显示在第一个 ul li 元素的顶部。 HTML: Home Merchants
我有一些结构如下的菜单: First level link 1 Child link 1 Child link 2
我有很长的ul,李的数目不是恒定的 1 2 3 4 5 6 7 8 9 我想使用Moovweb SDK将其分为两个ul。 1 2 3 4
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎偏离主题,因为它缺乏足够的信息来诊断问题。 更详细地描述您的问题或 include a mini
我有一棵信息“树”,显示在许多嵌套列表中(ul li ul li ....)。两个问题: 当我点击时,父 ul 和子 ul 都会切换。 如果我点击在其中没有 ul 的嵌套列表中(例如,下面的 Cran
我正在尝试在 jQuery 中创建以下内容: 我有一个项目列表(例如 10 个)。如果项目数超过 6,则将剩余项目(从 6 到 10)复制到新的 UL 中以创建下拉菜单结构。 菜单的第一个版本是 ht
嘿大家 - 我在工作中尝试 jquery 的第二天,有点卡住了。 我有一个无序列表的链接..在无序列表的链接中 点击 ,我想要的 child 变得可见。 点击(文档上的任何位置)后,我想要 child
嗨,这就是我想要实现的目标。我有一个 ID="columns"的 div,在本例中我有 3 列,但可能会有更多或更少...我正在使用 JQuery 动态添加列表项。
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Using .after() to add html closing and open tags 我想显示高度几乎相
我是一名优秀的程序员,十分优秀!