温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

css匀速的方法

发布时间:2021-07-14 13:45:38 来源:亿速云 阅读:178 作者:chen 栏目:web开发

本篇内容主要讲解“css匀速的方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“css匀速的方法”吧!

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

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

ease:

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

2、linear:(匀速)

3、ease-in:(加速)

4、ease-out:(减速)

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

6、cubic-bezier

如:

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

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

css匀速的方法

css匀速的方法

例子2:

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

p
{
width:100px;
transition: width 2s;
-moz-transition: width 2s; /* Firefox 4 */
-webkit-transition: width 2s; /* Safari 和 Chrome */
-o-transition: width 2s; /* Opera */
}

效果图:

css匀速的方法

鼠标经过后

css匀速的方法

到此,相信大家对“css匀速的方法”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

css
AI