CSS3过渡动画

过渡动画

transition属性简介
transition是网页上的过渡动画,变化的逐渐过渡效果,简称过渡动画!
列如:
transition: property duration timing-function delay;
border-radius:圆角 transition:产生动画
transition:all ... ease所有一起变
liner:匀速 ease-in:开始是慢速
ease-out:结束时慢速
scale:缩放 perspective:透视距离
transform:交换 skew:斜切

动画代码作业

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>动画图</title>
<style type="text/css">
.content{
width: 300px;
height: 125px;
border: 1px solid #000;
margin: 200px auto 0;
}
.content p{
text-align: center;
width: 100%;

    }
    .content div{
        width: 30px;
        height: 70px;
        float: left;
        background-color: lilac;
        margin: 15px;
        border-radius: 10px;
    }
    .content div:nth-child(1){
        background-color: red;
        animation: loading 500ms ease 0s infinite alternate;
    }
    .content div:nth-child(2){
        background-color: pink;
        animation: loading 500ms ease 100ms infinite alternate;
    }
    .content div:nth-child(3){
        background-color: purple;
        animation: loading 500ms ease 200ms infinite alternate;
    }
    .content div:nth-child(4){
        background-color: ivory;
        animation: loading 500ms ease 300ms infinite alternate;
    }
    .content div:nth-child(5){
        background-color: gray;
        animation: loading 500ms ease 400ms infinite alternate;
    }
    @keyframes loading{
        from{
            transform: scaleY(1);
        }
        to{
            transform: scaleY(0.5);
        }
    }
</style>

</head>
<body>
<div class="content">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<p>loding</p>
</div>
</body>
<ml>


图片.png

animation动画

暂停动画
div
{
animation-direction:alternate;
-webkit-animation-direction:alternate; /* Safari 和 Chrome */
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容