我有一个WordPress网站,它使用Superfish菜单。该菜单在Chrome,Firefox和IE 10-11中运行良好,但它没有显示IE 6-9中的子菜单。子菜单看起来很透明"在IE 9中,我搜索过谷歌的解决方案,但似乎都没有。
我尝试过的方法:
z-index: 9999999
z-index: -1
visibility: visible; overflow: visible; opacity: 1
<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
这是我在style.css中的内容,其中superfish.css会覆盖:
.menu-main-container {
background: #60ac5f; /* Old browsers */
background: -moz-linear-gradient(top, #60ac5f 0%, #3a7539 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#60ac5f), color-stop(100%,#3a7539)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* IE10+ */
background: linear-gradient(to bottom, #60ac5f 0%,#3a7539 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#60ac5f', endColorstr='#3a7539',GradientType=0 ); /* IE6-9 */
position: fixed !important;
top: auto !important;
z-index: 151 !important;
}
#menu-main {
position: relative;
}
#menu-main li {
background: transparent !important;
}
#menu-main li a {
font-size: 17px;
font-weight: 400 !important;
font-family: "Open Sans";
border: none;
padding: 0.46em 1em;
}
#menu-main a:focus, #menu-main a:hover, #menu-main a:active, #menu-main .current_page_item, #menu-main li:hover, #menu-main li.sfHover {
outline: 0;
background: none repeat scroll 0 0 #E79E38 !important;
}
#menu-main li:hover ul, .menu li.sfHover ul {
top: 43px !important;
}
#menu-main ul {
z-index:999 !important;
}
#menu-main li ul li a{
font-size: 15px !important;
}
#menu-main li li {
background: none repeat scroll 0 0 #E79E38 !important;
border-bottom: 1px solid #BF711C !important;
}
#menu-main li ul li a:hover {
background: none repeat scroll 0 0 #DC8122 !important;
}
答案 0 :(得分:0)
好的,我找到了解决办法。问题是.menu-main-container
类的过滤器。
.menu-main-container {
background: #60ac5f; /* Old browsers */
background: -moz-linear-gradient(top, #60ac5f 0%, #3a7539 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#60ac5f), color-stop(100%,#3a7539)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* IE10+ */
background: linear-gradient(to bottom, #60ac5f 0%,#3a7539 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#60ac5f', endColorstr='#3a7539',GradientType=0 ); /* IE6-9 */
position: fixed !important;
top: auto !important;
z-index: 151 !important;
}
新代码:
.menu-main-container {
background: #60ac5f; /* Old browsers */
background: -moz-linear-gradient(top, #60ac5f 0%, #3a7539 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#60ac5f), color-stop(100%,#3a7539)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #60ac5f 0%,#3a7539 100%); /* IE10+ */
background: linear-gradient(to bottom, #60ac5f 0%,#3a7539 100%); /* W3C */
position: fixed !important;
top: auto !important;
z-index: 151 !important;
}