美文网首页
CSS-3D知识

CSS-3D知识

作者: 兔叔斯基 | 来源:发表于2021-01-10 11:55 被阅读0次

1.CSS动画

1.1 CSS动画属性-animation

animation:为CSS动画属性,使用该属性可以替代flash等动画效果,使其可以完成关键帧补充等效果。其需要和@keyframes配合使用,以满足动画效果。其余内容可参见:W3C-CSS动画讲解

CSS动画示例代码一

<!-- 示例代码二 -->

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>CSS 3D Learn</title>

</head>

<body>

    <div class="div1" onclick="paused()">

        css3 动画

    </div>

    <style>

        body {

            width: 99%;

            height: 100%;

        }

        .div1 {

            margin-top: 25%;

            border-radius: 7px;

            width: 80px;

            height: 50px;

            /* 使div文字居中的方法之一 */

            line-height: 50px;

            text-align: center;

            /* 若想使div移动,则需要设置定位为相对位置 */

            position: relative;

            /* 简写方式 */

            /* animation: test 15s infinite running;

            -webkit-animation: test 15s infinite running; */

            animation-name: test;

            -webkit-animation-name: test;

            /* duration 后面需要加单位s */

            -webkit-animation-duration: 15s;

            animation-duration: 15s;

            animation-iteration-count: infinite;

            animation-play-state: paused;

            animation-timing-function: linear;

            -webkit-animation-play-state: paused;

            background-color: aqua;

        }

        @keyframes test {

            0% {

                left: 0px;

            }

            15% {

                margin-top: 0px;

                left: 300px;

                /* transform: rotate(30deg); */

            }

            50% {

                margin-top: 25%;

                left: calc(100% - 85px);

                /* transform: rotate(30deg); */

                background-color: greenyellow;

            }

            65% {

                margin-top: 50%;

                left: calc(100% - 370px);

                /* transform: rotate(360deg); */

                background-color: bisque;

            }

            100% {

                margin-top: 25%;

                left: 0px;

            }

        }

    </style>

    <script>

        function paused() {

            document.getElementsByClassName("div1")[0].style.animationPlayState = "running";

        }

    </script>

</body>

</html>

相关文章

  • CSS-3D知识

    1.CSS动画 1.1 CSS动画属性-animation animation:为CSS动画属性,使用该属性可以替...

  • CSS-3D转换模块

    什么是2D和3D2D就是一个平面, 只有宽度和高度, 没有厚度3D就是一个立体, 有宽度和高度, 还有厚度默认情况...

  • 2-知识图谱后续

    知识表示与知识建模知识抽取知识挖掘知识存储知识融合知识推理语义搜索知识问答

  • 知识处理流程知识点

    知识处理的基本流程 处理的基本流程包括:知识抽取、知识表示、知识存储、知识融合、知识推理、知识可视化、知识应用、知...

  • 一花一世界,一叶一菩提

    知识诅咒---知识祝福---知识想象---知识魔法

  • 知识啊知识

    怎么样才能在外物阻挠中不遗初心 怎么在贫穷苦难中不失优雅 绝不会因为现实 出卖我的纯真 追随的信仰 爱情 我的灵魂...

  • 被信息淹没的年代,你的知识需要管理

    个人知识管理 学习知识 保存知识 共享知识 使用知识 知识创新enter image description he...

  • 知识图谱入门简介

    一、 知识图谱技术体系 知识图谱的构建主要涉及到知识建模、知识抽取、知识融合、知识存储、知识计算以及知识应用,具体...

  • 《你的知识需要管理》:学习知识

    田志刚《你的知识需要管理》认为知识管理包含五大块——学习知识、保存知识、共享知识、使用知识、创造知识 学习知识> ...

  • #思考#知识管理

    #思考#知识管理 知识管理流程:收集知识,吸收知识,实践操作应用知识,创造价值,分享知识,研究探讨。 收集知识,最...

网友评论

      本文标题:CSS-3D知识

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