美文网首页页面特效
CSS+HTML<文字抖动效果>

CSS+HTML<文字抖动效果>

作者: 誰在花里胡哨 | 来源:发表于2020-06-08 10:23 被阅读0次
    效果图:
    20200603.gif
    代码如下:
    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            body,
            html {
                height: 100%;
            }
    
            body {
                display: flex;
                justify-content: center;
                align-items: center;
            }
    
            .text {
                padding: 20px 70px;
                font-size: 20px;
                font-weight: bold;
                border: 2px solid black;
                letter-spacing: 0.5rem;
                cursor: pointer;
                user-select: none;
            }
    
            .text:hover {
                animation: text 0.2s linear infinite alternate;
            }
    
            @keyframes text {
                25% {
                    filter: drop-shadow(5px 5px 0px rgb(0, 81, 255));
                }
                75% {
                    filter: drop-shadow(-4px -5px 0px rgb(247, 0, 255));
                }
                85%{
                    filter: drop-shadow(5px -3px 0px rgb(255, 238, 0));
                }
            }
        </style>
    </head>
    
    <body>
        <div class="text">抖动</div>
    </body>
    
    </html>
    

    相关文章

      网友评论

        本文标题:CSS+HTML<文字抖动效果>

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