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>
相关推荐
可达鸭小栈15 小时前
易语言实现CSS像素文字生成器:无需字体文件渲染汉字
前端·css
yqcoder16 小时前
CSS 迷思破解:`:nth-child` vs `:nth-of-type`
前端·css
遇见~未来16 小时前
第六篇_CSS进阶_深入浏览器与工程化
前端·css·rust
xingpanvip17 小时前
星盘接口开发文档:日运语料接口指南
android·开发语言·前端·css·php·lua
之歆18 小时前
Day05_CSS完整博客笔记(下)
前端·css·笔记
之歆18 小时前
Day05_CSS完整博客笔记(上)
前端·css·笔记
ZC跨境爬虫18 小时前
跟着 MDN 学 HTML day_7:(进阶文本语义标签全覆盖)
前端·javascript·css·ui·html
Dxy123931021618 小时前
CSS的伪类简介
前端·css
是上好佳佳佳呀21 小时前
【前端(十)】CSS 过渡与动画笔记
前端·css·笔记
ZhengEnCi1 天前
M5-markconv自定义CSS样式指南 📝
前端·css·python