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>
相关推荐
来碗旺仔4 小时前
2026年了,CSS 终于能写 if 了
css
Moriarty1236664 小时前
【前端技巧】实现卡片页面容器全屏
前端·css
大梦想家a6 小时前
基于 HTML+CSS 的个人生活主页设计与实现
css·html·生活
梦醒沉醉21 小时前
3、CSS入门——CSS选择器
css
Z兽兽1 天前
行内块元素在垂直方向上对齐问题
css·html·css3
小幸运2481 天前
Vue.js 在博客平台中为何采用响应式系统而非直接操作
css
dsyuan0011 天前
基于 Vue3 + ElementPlus 极简搭建仿钉钉流程设计器,简洁架构、极易扩展,纯div+css布局
css·架构·钉钉
bjzhang751 天前
使用HTML+CSS美化上传进度条展示
前端·css·html
YWL1 天前
CSS变量与预处理器
前端·css
吴长建先生重名了2 天前
用 MinIO 分布式存储模块一次讲清代码重构与整洁代码实
css