以下是网站:http://www.mccaonline.com
我被雇用来处理网站上渐变菜单的问题。该菜单在Firefox,Chrome和Safari中正常运行 - 当您将鼠标悬停在菜单元素上时,背景将变为浅绿色渐变。但是,在IE8和IE9中,所有子菜单元素都分配了浅绿色渐变背景。
我只是希望它在Internet Explorer中的功能相同,并且无法弄清楚是什么导致它在所有子菜单元素上具有渐变背景。我用于导航的CSS如下:
#navigation {
background: rgb(100,135,125); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(100,135,125,1) 0%, rgba(126,181,165,1) 50%, rgba(126,181,165,1) 52%, rgba(143,190,174,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(100,135,125,1)), color-stop(50%,rgba(126,181,165,1)), color-stop(52%,rgba(126,181,165,1)), color-stop(100%,rgba(143,190,174,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#64877d', endColorstr='#8fbeae',GradientType=0 ); /* IE6-8 */
}
/* HOVER STATE OF NAV BAR */
#navigation ul.nav > li:hover,
#navigation ul.nav > li a:hover,
ul.nav li.current_page_item a,
ul.nav li.current_page_parent a,
ul.nav li.current-menu-ancestor a,
ul.nav li.current-cat a,
ul.nav li.li.current-menu-item a {
background: rgb(100,135,125); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(100,135,125,1) 0%, rgba(136,197,158,1) 47%, rgba(196,233,188,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(100,135,125,1)), color-stop(47%,rgba(136,197,158,1)), color-stop(100%,rgba(196,233,188,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#64877d', endColorstr='#c4e9bc',GradientType=0 ); /* IE6-8 */
color: #ffffff;
}
#navigation {
background: rgb(100,135,125); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(100,135,125,1) 0%, rgba(126,181,165,1) 50%, rgba(126,181,165,1) 52%, rgba(143,190,174,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(100,135,125,1)), color-stop(50%,rgba(126,181,165,1)), color-stop(52%,rgba(126,181,165,1)), color-stop(100%,rgba(143,190,174,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(100,135,125,1) 0%,rgba(126,181,165,1) 50%,rgba(126,181,165,1) 52%,rgba(143,190,174,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#64877d', endColorstr='#8fbeae',GradientType=0 ); /* IE6-8 */
}
/* HOVER STATE OF NAV BAR */
#navigation ul.nav > li:hover,
#navigation ul.nav > li a:hover,
ul.nav li.current_page_item a,
ul.nav li.current_page_parent a,
ul.nav li.current-menu-ancestor a,
ul.nav li.current-cat a,
ul.nav li.li.current-menu-item a {
background: rgb(100,135,125); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(100,135,125,1) 0%, rgba(136,197,158,1) 47%, rgba(196,233,188,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(100,135,125,1)), color-stop(47%,rgba(136,197,158,1)), color-stop(100%,rgba(196,233,188,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(100,135,125,1) 0%,rgba(136,197,158,1) 47%,rgba(196,233,188,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#64877d', endColorstr='#c4e9bc',GradientType=0 ); /* IE6-8 */
color: #ffffff;
}
让我知道您的想法或可能导致此问题的原因。我非常感谢任何帮助!
答案 0 :(得分:1)
在你的CSS中添加它。
#navigation ul.nav .sub-menu li:hover , #navigation ul.nav .sub-menu li a:hover {background:none!important
你会得到你的解决方案。
答案 1 :(得分:0)
您的样式不使用.sub-menu类,您是否尝试使用类删除背景:
.sub-menu .menu-item {
background: ...
答案 2 :(得分:0)
取下过滤器标签并在jquery中处理菜单。它会影响菜单上的2级。