IE8中的CSS无法正常工作

时间:2013-05-02 08:50:10

标签: css css3 animation menu internet-explorer-8

这是我的头脑,请有人帮忙吗?我已经建立了一个网站,在Ie9 + 10和所有其他浏览器中工作,但动画菜单在IE8中不起作用,有人使用它来查看网站..

这是css:

.menu, .menu ul, .menu li, .menu a {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.menu {
    height: 40px;
    width: 800px;
    background: #f7d000;
    background: -webkit-linear-gradient(top, #f7d000 0%,#f7d000 100%);
    background: -moz-linear-gradient(top, #f7d000 0%,#f7d000100%);
    background: -o-linear-gradient(top, #f7d000 0%,#f7d000 100%);
    background: -ms-linear-gradient(top, #f7d000 0%,#f7d000 100%);
    background: linear-gradient(top, #f7d000 0%,#f7d000 100%);
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    border-radius: 0px;
}

.menu li {
    position: relative;
    list-style: none;
    float: left;
    display: block;
    height: 50px;
}

.menu li a {
    display: block;
    padding: 0 14px;
    margin: 5px 0;
    line-height: 28px;
    text-decoration: none;
    font-family: 'Titillium Web', sans-serif;
    font-weight: bold;
    font-size: 15px;
    color: #000000;
    -webkit-transition: color .2s ease-in-out;
    -moz-transition: color .2s ease-in-out;
    -o-transition: color .2s ease-in-out;
    -ms-transition: color .2s ease-in-out;
    transition: color .2s ease-in-out;
}

.menu li:first-child a {
    border-left: none;
}

.menu li:last-child a {
    border-right: none;
}

.menu li:hover > a {
    color: #ffffff;
}

.menu ul {
    position: absolute;
    top: 40px;
    left: 0;
    z-index: 999;
    opacity: 0;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    background: #f7d000;
    -webkit-border-radius: 0 0 5px 5px;
    -moz-border-radius: 0 0 5px 5px;
    border-radius: 0 0 5px 5px;
    -webkit-transition: opacity .25s ease .1s;
    -moz-transition: opacity .25s ease .1s;
    -o-transition: opacity .25s ease .1s;
    -ms-transition: opacity .25s ease .1s;
    transition: opacity .25s ease .1s;
}

.menu li:hover > ul {
    opacity: 1;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}

.menu ul li {
    height: 0;
    overflow: visible;
    padding: 0;
    -webkit-transition: height .25s ease .1s;
    -moz-transition: height .25s ease .1s;
    -o-transition: height .25s ease .1s;
    -ms-transition: height .25s ease .1s;
    transition: height .25s ease .1s;
}

.menu li:hover > ul li {
    height: 36px;
    overflow: visible;
    padding: 0;
}

.menu ul li a {
    width: 180px;
    padding: 8px 10px;
    margin: 0;
    border: none;
    border-bottom: 1px solid #f7d000;
}

.menu ul li:last-child a {
    border: none;
}

该网站是:www.softwaretestingawards.com任何帮助将不胜感激!

3 个答案:

答案 0 :(得分:3)

IE8不支持CSS3动画。

参见此参考: http://caniuse.com/#search=css%20tran


许多人都想考虑使用javascript动画,例如jQuery.animate

http://api.jquery.com/animate/

答案 1 :(得分:0)

它在Internet Explorer 8中不起作用的原因是因为它不支持CSS3动画。我建议您创建一个脚本来检测是否正在使用Internet Explorer 8,如果是,则动态更改网站,使其不具有奇特的CSS3动画。

答案 2 :(得分:0)

要在IE8中使用css,你可以尝试使用PIE.htc,如果你想http://css3pie.com/demos/,请参考这个网站寻找解决方案和演示,实际上它对我有用:)