当前位置:首页 > 网站应用 > 正文内容

纯css实现文字音符跳动效果

cjw1237个月前 (11-24)网站应用1430

通过纯css实现文字音符跳动效果。点下面的运行可以查看效果!

<!doctype html><html>
    <head>
        <meta charset="utf-8">
        <title>纯CSS文字跳动音符效果</title>
        <style>
            html,
            body {
                width: 100%;
                height: 100%;
                background: #00ffac;
                background: -webkit-linear-gradient(45deg, #00ffac 0%, #0472FF 100%);
                background: -webkit-linear-gradient(45deg, #00ffac 0%, #0472FF 100%);
                background: linear-gradient(45deg, #00ffac 0%, #0472FF 100%);
                overflow: hidden;
                -webkit-font-smoothing: antialiased;
                display: -webkit-box;
                display: -webkit-flex;
                display: -ms-flexbox;
                display: flex;
                -webkit-box-pack: center;
                -webkit-justify-content: center;
                -ms-flex-pack: center;
                justify-content: center;
                -webkit-box-align: center;
                -webkit-align-items: center;
                -ms-flex-align: center;
                align-items: center;
            }

            h1 {height: 100px;}

            h1 span {
                position: relative;
                top: 20px;
                display: inline-block;
                -webkit-animation: bounce .3s ease infinite alternate;
                animation: bounce .3s ease infinite alternate;
                font-family: 'Titan One', cursive;
                font-size: 80px;
                color: #FFF;
                text-shadow: 0 1px 0 #CCC,                    0 2px 0 #CCC,                    0 3px 0 #CCC,                    0 4px 0 #CCC,                    0 5px 0 #CCC,                    0 6px 0 transparent,                    0 7px 0 transparent,                    0 8px 0 transparent,                    0 9px 0 transparent,                    0 10px 10px rgba(0, 0, 0, .4);
            }

            h1 span:nth-child(2) {
                -webkit-animation-delay: .1s;
                animation-delay: .1s;
            }

            h1 span:nth-child(3) {
                -webkit-animation-delay: .2s;
                animation-delay: .2s;
            }

            h1 span:nth-child(4) {
                -webkit-animation-delay: .3s;
                animation-delay: .3s;
            }

            h1 span:nth-child(5) {
                -webkit-animation-delay: .4s;
                animation-delay: .4s;
            }

            h1 span:nth-child(6) {
                -webkit-animation-delay: .5s;
                animation-delay: .5s;
            }

            h1 span:nth-child(7) {
                -webkit-animation-delay: .6s;
                animation-delay: .6s;
            }

            @-webkit-keyframes bounce {
                100% {
                    top: -20px;
                    text-shadow: 0 1px 0 #CCC,                        0 2px 0 #CCC,                        0 3px 0 #CCC,                        0 4px 0 #CCC,                        0 5px 0 #CCC,                        0 6px 0 #CCC,                        0 7px 0 #CCC,                        0 8px 0 #CCC,                        0 9px 0 #CCC,                        0 50px 25px rgba(0, 0, 0, .2);
                }
            }

            @keyframes bounce {
                100% {
                    top: -20px;
                    text-shadow: 0 1px 0 #CCC,                        0 2px 0 #CCC,                        0 3px 0 #CCC,                        0 4px 0 #CCC,                        0 5px 0 #CCC,                        0 6px 0 #CCC,                        0 7px 0 #CCC,                        0 8px 0 #CCC,                        0 9px 0 #CCC,                        0 50px 25px rgba(0, 0, 0, .2);
                }
            }
        </style>
    </head>
    <body>
        <h1>
            <span>c</span>
            <span>j</span>
            <span>w</span>
            <span>1</span>
            <span>2</span>
            <span>3</span>
        </h1>
    </body></html>


扫描二维码推送至手机访问。

版权声明:本文由追求完美发布,如需转载请注明出处。

本文链接:https://cjw123.com/blog/?id=138

分享给朋友:

相关文章

html meta标签屏蔽搜索引擎的用法

html页面中的 meta 标签可以用来识别搜索引擎的蜘蛛类型,可以规定meta标签所在的html页面是否被蜘蛛抓取,下面是这个meta标签的用法,大家可以借鉴一下。搜索引擎的 meta 标签的解析下面是meta标签对搜索引擎的解析<meta name='robot...

css3动画实现滚动字,类似航班信息,超出滚动,不超出不滚动

文字走马灯,手机的弹幕等等。js可以动态的计算宽度,但js做动画需要定时器,很不方便。其实就是里外容器对向滚动,滚动的值为里外容器宽度的差值,如果里容器与外容器等宽,那么差值就为0,视觉上是没有滚动的,就像第一条数据;如果里容器宽度比外容器宽,里容器向左滚动的距离比外容器向右滚动的距离大,就会形成滚...

js报表双击固定样式,用于对比

在很多报表中,需要鼠标上下选择时显示对比颜色,在双击时显示固定的色表示选中状态。<table style="width:80%" border=1 onmouseover="getrow(this)" onmous...

纯css实现弹出图层背景变灰特效

<style> .bg{position:absolute;z-index:999;filter:alpha(opacity=50);background:#666;opacity: 0.5;-moz-opacity: 0.5;left:0;top:0;height...

google谷歌翻译镜像网站

查找外文资料对于外语不好的那必须要借助翻译工具,各家翻译工具各有不同,想要使用google谷歌翻译,奈何无法访问,那么如何在国内使用谷歌翻译?google谷歌翻译镜像网站有哪些?https://translate.yunkuerp.cn/https://translate.renwole.com/h...

html中文本不停变色的特效

<HTML><HEAD><TITLE>文本特效篇--文本不停变色</TITLE> </HEAD> <BODY bgcolor="#fef4d2"> <br> <center...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。