好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css动画怎么匀速

在css中,可以使用trans IT ion -t iming-function属性设置动画匀速,只需要在元素中添加“transition-timing-function:linear;”样式即可。

本教程操作环境:windows7系统、CSS3 && HT ML 5版、Dell G3 电 脑。

ease:

1、ease:(逐渐变慢)默认值

2、linear:(匀速)

3、ease -i n:(加速)

4、ease-out:(减速)

5、ease-in-out:(加速然后减速)

6、c ub ic-bezier

如:

<!DOCTY PE  html><html lang="en"><head>
    < ;m eta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        *{m arg in:0; padding: 0;}
        .icon_down{ width: 0; h ei ght: 0; border-left:20px solid transparent; border-right: 20px solid transparent; border-top:20px solid  # B03939; transition: all .1s ease-in 0ms; mar gin :50px auto; cursor: pointer; }
        .icon_down:hover{ transform: rotate(180 deg );}
    </style></head><body>
    <p class="icon_down"></p></body></html>

效果图:鼠标经过旋转180度,

例子2:

把 鼠标指针 放到 p 元素上,其 宽 度会从 100px 逐渐变为 300px:

p
{
width:100px;
transition: width 2s;
-moz-transition: width 2s; /* Firefox 4 */
- webkit -transition: width 2s; /* Safari 和 Ch rom e */
-o-transition: width 2s; /*  opera  */
}

效果图:

鼠标经过后

推荐学习:css视频教程

以上就是css动画怎么匀速的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css动画怎么匀速 全部内容,希望文章能够帮你解决 css动画怎么匀速 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css动画怎么匀速的详细内容...

  阅读:33次

上一篇: css框架如何使用

下一篇:Css可以干些什么