首页 建站教程 WEB前端 正文

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

通过纯css实现文字音符跳动效果 完整代码: <!doctype html> <html> <head> <meta charset="utf-8"> <title>纯css文...

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

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

完整代码:

<!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>u</span>
            <span>m</span>
            <span>T</span>
            <span>h</span>
            <span>e</span>
            <span>m</span>
            <span>e</span>
        </h1>
    </body>
</html>

演示效果

打赏
海报

声明:本站部分资源内容为站内原创著作,也有部分基于互联网公开分享整理,版权归原作者所有。
如侵犯到您的权益,请联系本站,我们会尽快处理,谢谢。转摘请注明出处

本文链接:https://www.umtheme.com/web/206.html

相关推荐

纯css实现菜单或列表循环向上滚动效果

纯css实现菜单或列表循环向上滚动效果

在前端开发过程中,有时候针对某个模块需要无限循环的滚动一些消息或菜单,我们常用的方法基本上都是通过js来实现,虽然代码相对来说可能会精简一些,但是对于JS不是很熟悉的同学来说还是不太好理解,毕竟相对于...
WEB前端 2022.08.17 0 185
纯CSS3实现3D切换选项卡

纯CSS3实现3D切换选项卡

Tab选项卡是大家最常用的功能之一,因为兼容性的问题目前大多朋友也都是用js书写,当然我也会用JS去书写,必定web端的应用你的用户群体...
WEB前端 2022.08.16 0 298
发布评论

ainiaobaibaibaibaobaobeishangbishibizuichiguachijingchongjingdahaqiandaliandangaodw_dogedw_erhadw_miaodw_tuzidw_xiongmaodw_zhutouganbeigeiliguiguolaiguzhanghahahahashoushihaixiuhanheixianhenghorse2huaixiaohuatonghuaxinhufenjiayoujiyankeaikeliankouzhaokukuloukunkuxiaolandelinileimuliwulxhainiolxhlikelxhqiuguanzhulxhtouxiaolxhwahahalxhzanningwennonuokpinganqianqiaoqinqinquantouruoshayanshengbingshiwangshuaishuijiaosikaostar0star2star3taikaixintanshoutianpingtouxiaotuwabiweifengweiquweiwuweixiaowenhaowoshouwuxiangjixianhuaxiaoerbuyuxiaokuxiaoxinxinxinxinsuixixixuyeyinxianyinyueyouhenghengyuebingyueliangyunzanzhajizhongguozanzhoumazhuakuangzuohenghengzuoyi
感谢您的支持