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>
相关推荐
ZC跨境爬虫13 小时前
跟着 MDN 学CSS day_10:(博客页面样式修复实战挑战)
前端·css
ZC跨境爬虫16 小时前
跟着 MDN 学CSS day_9:(深入掌握CSS选择器核心技能测试)
前端·css·ui·html
ZC跨境爬虫18 小时前
跟着 MDN 学CSS day_11:(深入理解CSS值与单位的完整体系)
前端·css·ui·html·tensorflow
希冀1231 天前
【CSS学习第十一篇】
前端·css·学习
小贺儿开发1 天前
一句话生成网页 + 自动化办公(OpenCode + DeepSeek-V4)
css·自动化·html·工具·代码·网页·deepseek
代码煮茶2 天前
CSS 单位完全指南:px、em、rem、vw、vh、clamp 详解
前端·css
ZC跨境爬虫2 天前
跟着 MDN 学CSS day_8:(盒模型完全解)
前端·javascript·css·ui·交互
ZC跨境爬虫2 天前
跟着 MDN 学CSS day_6:(伪类和伪元素详解)
前端·javascript·css·数据库·ui·html
一颗小青松2 天前
css 文字区域根据图片形状显示,根据文字设置背景图
前端·css