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>
相关推荐
是立不是利11 小时前
写给设计师的 CSS 博客美学指南
前端·css
labixiong17 小时前
CSS 锚点定位实测:零 JS 实现气泡跟随,自动翻转很香但暗藏 3 个致命坑
前端·css
芳心粽伙饭18 小时前
CSS第一章 CSS引入
前端·css
Linsk21 小时前
妙用:focus解决0到auto高度过渡的边界场景
前端·css
芳心粽伙饭1 天前
CSS第二章 选择器
前端·css
梦醒沉醉2 天前
4、CSS入门——属性选择器
css
এ慕ོ冬℘゜2 天前
样式控制 .css ()
前端·css
来碗旺仔2 天前
2026年了,CSS 终于能写 if 了
css
Moriarty1236662 天前
【前端技巧】实现卡片页面容器全屏
前端·css
大梦想家a2 天前
基于 HTML+CSS 的个人生活主页设计与实现
css·html·生活