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>
相关推荐
溪语流沙18 小时前
【每天一个CSS | Day41】开关三连:一套状态机,三种视觉翻译
前端·css·html5·每日一练·按钮
变与不变80618 小时前
css定位布局精讲
前端·css
前端架构师-老李2 天前
HTML与CSS基础第五课—HTML的空格、换行、横线相关知识
前端·css·html
echome8882 天前
CSS 布局:Flex 和 Grid 怎么选,附常见坑
前端·css·html
东鹏特饮2 天前
本机状态监控页面html
运维·css·html·css3
蓝莓味的口香糖3 天前
【VUE】【CSS】Vue移动端适配主流方案总结
前端·css·vue.js
是立不是利3 天前
CSS 的 Flex 布局——为什么元素没有按我想的排列
前端·css
java1234_小锋4 天前
【技术专题】CSS3 网页技术 - CSS3 盒模型
前端·css·css3
前端架构师-老李4 天前
HTML与CSS基础第四课—strong、em、b、i 各表示什么
前端·css·html
程序0074 天前
天地图实现收货地址定位
前端·javascript·css