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>
相关推荐
霍理迪1 天前
CSS布局方式——定位
前端·css
灯把黑夜烧了一个洞1 天前
2026年跨年倒计时网页版
javascript·css·html·2026跨年代码·新年代码
铅笔侠_小龙虾1 天前
html+css 实现键盘
前端·css·html
韩曙亮1 天前
【Web APIs】移动端返回顶部案例 ( 返回顶部按钮 显示 / 隐藏 设置 | 返回顶部操作 )
前端·javascript·css·html·移动端·web apis·返回顶部
GDAL1 天前
Tailwind CSS 响应式设计实战指南:从零搭建书签篮自适应页面
前端·css·tailwindcss·书签篮
cz追天之路2 天前
华为机考--- 字符串最后一个单词的长度
javascript·css·华为·less
Light602 天前
CSS逻辑革命:原生if()函数如何重塑我们的样式编写思维
前端·css·响应式设计·组件化开发·css if函数·声明式ui·现代css
前端Hardy2 天前
祝大家 2026 年新年快乐,代码无 bug,需求一次过
javascript·css·html
be or not to be2 天前
HTML+CSS 浮动与表格全总结笔记
css·笔记·html
秋雨雁南飞2 天前
WaferMap.HTML
前端·css·html