CSS 3.0文字悬停跳动特效代码

建站知识 2021-07-03 07:55www.168986.cn长沙网站建设

给大家分享一个用CSS 3.0实现的文字悬停跳动特效,效果如下 

 以下是代码实现,欢迎大家复制粘贴和收藏。

<!DOCTYPE html>
<html lang="en">
 
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>CSS 3.0文字悬停跳动特效</title>
        <style>
             {
                margin: 0;
                padding: 0;
            }
            body {
                display: flex;
                justify-content: center;
                align-items: center;
                min-height: 100vh;
                background: #000;
            }
 
            .loader {
                position: relative;
            }
 
            .loader span {
                position: relative;
                font-size: 2em;
                color: #fff;
                display: inline-block;
                text-transform: uppercase;
                animation: animate 2s ease-in-out infinite;
                animation-delay: calc(0.1s  var(--i));
                animation-play-state: paused;
            }
 
            .loader:hover span {
                animation-play-state: running;
            }
            @keyframes animate {
 
                0%,
                40%,
                100% {
                    transform: translateY(0);
                }
 
                20% {
                    transform: translateY(-50px);
                }
            }
        </style>
    </head>
 
    <body>
        <div class="loader">
            <span style="--i:1;">A</span>
            <span style="--i:2;">n</span>
            <span style="--i:3;">i</span>
            <span style="--i:4;">m</span>
            <span style="--i:5;">a</span>
            <span style="--i:6;">t</span>
            <span style="--i:7;">i</span>
            <span style="--i:8;">o</span>
            <span style="--i:9;">n</span>
            <span style="--i:10;">_</span>
            <span style="--i:11;">P</span>
            <span style="--i:12;">l</span>
            <span style="--i:13;">a</span>
            <span style="--i:14;">y</span>
            <span style="--i:15;">_</span>
            <span style="--i:16;">S</span>
            <span style="--i:17;">t</span>
            <span style="--i:18;">a</span>
            <span style="--i:19;">t</span>
            <span style="--i:20;">e</span>
            <span style="--i:21;">.</span>
        </div>
    </body>
 
</html>

到此这篇关于CSS 3.0文字悬停跳动特效代码的文章就介绍到这了,更多相关CSS 3.0文字悬停跳动内容请搜索狼蚁SEO以前的文章或继续浏览狼蚁网站SEO优化的相关文章,希望大家以后多多支持狼蚁SEO!

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by