美文网首页
CSS3 transition 浏览器兼容性

CSS3 transition 浏览器兼容性

作者: 王翔爱摇滚乐爱电影爱心理学爱哲 | 来源:发表于2017-08-02 11:01 被阅读0次

    1、兼容性

    根据canius(http://caniuse.com/#search=transition),transition 兼容性如下图所示:

    Paste_Image.png
    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    div
    {
    width:100px;
    height:100px;
    background:blue;
    transition:width 2s;
    -moz-transition:width 2s; /* Firefox 4 */
    -webkit-transition:width 2s; /* Safari and Chrome */
    -o-transition:width 2s; /* Opera */
    }
    
    div:hover
    {
    width:300px;
    }
    </style>
    </head>
    <body>
    
    <div></div>
    
    <p>请把鼠标指针移动到蓝色的 div 元素上,就可以看到过渡效果。</p>
    
    <p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
    
    </body>
    </html>
    

    在IE7-9进行测试时,transition的效果没有过渡效果(如线性过渡效果),但是还是有效果(立即执行transition-propertytransition-durationtransition-timing-functiontransition-delay都不起作用)

    作者:王翔 QQ:592767079 Email:wangxianglengye.com 期待共同进步!

    相关文章

      网友评论

          本文标题:CSS3 transition 浏览器兼容性

          本文链接:https://www.haomeiwen.com/subject/ityelxtx.html