css 文字左右抖动效果

html 复制代码
<template>
  <div class="box">
    <div class="shake shape">抖动特效交字11</div>
  </div>
</template>

<script setup></script>

<style scope>
.shape {
    margin: 50px;
    width: 200px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border: 1px solid black;
 }


.shake:hover {
    animation: shakeAnimal 800ms ease-in-out;
}
@keyframes shakeAnimal { /* 水平抖动,核心代码 */
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(+2px, 0, 0); }
    30%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(+4px, 0, 0); }
    50% { transform: translate3d(-4px, 0, 0); }
}

</style>
相关推荐
秋殇与星河2 小时前
CSS总结
前端·css
神之王楠2 小时前
如何通过js加载css和html
javascript·css·html
软件开发技术深度爱好者6 小时前
用HTML5+CSS+JavaScript庆祝国庆
javascript·css·html5
昨天;明天。今天。12 小时前
案例-表白墙简单实现
前端·javascript·css
金灰18 小时前
CSS3练习--电商web
前端·css·css3
TonyH200218 小时前
webpack 4 的 30 个步骤构建 react 开发环境
前端·css·react.js·webpack·postcss·打包
王小二(海阔天空)18 小时前
个人文章合集 - 前端相关
前端·css·vue·jquery
吕永强19 小时前
CSS相关属性和显示模式
前端·css·css3
赵锦川19 小时前
css三角形:css画箭头向下的三角形
前端·css
小白求学121 小时前
CSS计数器
前端·css