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>
相关推荐
java1234_小锋17 小时前
【技术专题】CSS3 网页技术 - CSS3 盒模型
前端·css·css3
前端架构师-老李18 小时前
HTML与CSS基础第四课—strong、em、b、i 各表示什么
前端·css·html
程序00719 小时前
天地图实现收货地址定位
前端·javascript·css
汤米粥21 小时前
目前流行的前端 CSS 框架
前端·css·bootstrap·ant design·‌tailwind css·bulma
是立不是利1 天前
CSS 的层叠与优先级——为什么我的样式不生效
前端·css
前端架构师-老李2 天前
HTML与CSS基础第二课—初识HTML
前端·css·html
java1234_小锋2 天前
【技术专题】CSS3 网页技术 - CSS3 单位、颜色、字体与文本
前端·css·css3
CappuccinoRose2 天前
拖拽交互体系
前端·javascript·css·html·交互·1024程序员节
神膘护体小月半2 天前
flex 布局的 order 属性
前端·css
java1234_小锋2 天前
【技术专题】CSS3 网页技术 - CSS3 优先级
前端·css·css3