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>
相关推荐
echome8889 分钟前
CSS 布局:Flex 和 Grid 怎么选,附常见坑
前端·css·html
东鹏特饮1 小时前
本机状态监控页面html
运维·css·html·css3
蓝莓味的口香糖1 天前
【VUE】【CSS】Vue移动端适配主流方案总结
前端·css·vue.js
是立不是利1 天前
CSS 的 Flex 布局——为什么元素没有按我想的排列
前端·css
java1234_小锋2 天前
【技术专题】CSS3 网页技术 - CSS3 盒模型
前端·css·css3
前端架构师-老李2 天前
HTML与CSS基础第四课—strong、em、b、i 各表示什么
前端·css·html
程序0072 天前
天地图实现收货地址定位
前端·javascript·css
汤米粥2 天前
目前流行的前端 CSS 框架
前端·css·bootstrap·ant design·‌tailwind css·bulma
是立不是利2 天前
CSS 的层叠与优先级——为什么我的样式不生效
前端·css
前端架构师-老李3 天前
HTML与CSS基础第二课—初识HTML
前端·css·html