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>
相关推荐
之歆9 小时前
Day07_CSS盒子模型 · 样式继承 · 用户代理样式
前端·css
爱上好庆祝11 小时前
学习js的第五天
前端·css·学习·html·css3·js
EnCi Zheng12 小时前
M5-markconv自定义CSS样式指南 [特殊字符]
前端·css·python
前端老石人12 小时前
前端开发中的 URL 完全指南
开发语言·前端·javascript·css·html
用户0595401744613 小时前
把多级缓存一致性验证从手工测试换成 Pytest 参数化,Bug 排查时间缩短 90%
前端·css
用户0595401744614 小时前
把 Redis 持久化测试从 800 行 Shell 换成 30 行 pytest,排错效率翻了 10 倍
前端·css
W.A委员会14 小时前
多行溢出在末尾添加省略号
开发语言·javascript·css
ZC跨境爬虫16 小时前
跟着 MDN 学 HTML day_8:(高级文本语义标签+适配核心功底)
前端·css·笔记·ui·html
里欧跑得慢1 天前
17. Flutter Hero动画实现:让界面过渡更加优雅
前端·css·flutter·web
凯瑟琳.奥古斯特1 天前
Redis是什么及核心特性
前端·css·redis·缓存