【问题标题】:2 backgrounds on a hover don't work on IE2 悬停背景不适用于 IE
【发布时间】:2012-03-26 03:05:05
【问题描述】:

我正在尝试在水平菜单中的 li a:hover 上使用 2 个不同的背景。它似乎适用于 FF 和 chrome,但不适用于 IE。 这是使用 css 的水平菜单的 css

#layTopMenu 
{ 
    position: relative; 
    width: 970px;
    height: 52px; 
    padding-top: 1px; 
    margin: 0 auto;
    z-index: 5; 
}
#layTopMenu ul
{ 
    position: relative; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}
#layTopMenu ul li 
{ 
    position: relative; 
    float: left; 
    margin: 0; 
    padding: 0 1px; 
    background: transparent url(../images/divider.gif) right no-repeat;
}
#layTopMenu ul li a {  
    color: #fff; 
    position: relative; 
    display: inline-block; 
    text-decoration: none; 
    margin: 0; 
    padding: 0 20px; 
    text-transform: uppercase; 
    text-align:center; 
    height: 49px; 
    line-height: 49px;
}
#layTopMenu ul li a:hover 
{ 
    color: #fff; 
    background:url(../images/nav_dot.gif) no-repeat center, url(../images/tab_hover_bg.gif) repeat-x; 
    text-align:center;    
    text-decoration: none;
}

【问题讨论】:

    标签: internet-explorer css hover


    【解决方案1】:

    here。

    【讨论】:

      【解决方案2】:

      您正在测试哪个版本的 IE? IE8 及之前的版本将不支持使用 CSS 的多背景。

      http://caniuse.com/multibackgrounds

      【讨论】:

        猜你喜欢
        • 2013-01-02
        • 2013-01-19
        • 1970-01-01
        • 1970-01-01
        • 2013-06-28
        • 2017-05-12
        • 2013-12-04
        • 2013-01-18
        • 1970-01-01
        相关资源
        最近更新 更多