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>
相关推荐
NEXT067 小时前
BFC布局
前端·css·面试
岱宗夫up7 小时前
【前端基础】HTML + CSS + JavaScript 进阶(一)
开发语言·前端·javascript·css·html
岱宗夫up8 小时前
【前端基础】HTML + CSS + JavaScript 基础(三)
开发语言·前端·javascript·css·html
程序员小李白1 天前
CSS 盒子模型
前端·css·html
Zzz不能停1 天前
单行 / 多行文本显示省略号(CSS 实现)
前端·css
键盘鼓手苏苏1 天前
Flutter for OpenHarmony:csslib 强力 CSS 样式解析器,构建自定义渲染引擎的基石(Dart 官方解析库) 深度解析与鸿蒙适配指南
css·flutter·harmonyos
xiaoxue..1 天前
TailwindCSS:从“样式民工”到“UI乐高大师”的逆袭
前端·css·ui
Amumu121381 天前
CSS引入方式
前端·css
PieroPc1 天前
用html+css+js 写一个Docker 教程
javascript·css·docker·html
菜鸟小芯1 天前
【GLM-5 陪练式前端新手入门】第二篇:CSS 让网页从 “能用” 变 “好看”
前端·css