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>
相关推荐
han_7 小时前
前端高频面试题之CSS篇(一)
前端·css·面试
不会玩电脑的Xin.11 小时前
HTML + CSS
前端·css·html
悟能不能悟21 小时前
<style scoped>vue中怎么引用css文件
css·vue.js
粉末的沉淀1 天前
css:制作带边框的气泡框
前端·javascript·css
西游音月1 天前
(4)pytest+Selenium自动化测试-元素定位之CSS Selector定位
css·selenium·pytest
谢尔登1 天前
【CSS】样式隔离
前端·css
LQW_home2 天前
前端展示 接受springboot Flux数据demo
前端·css·css3
WebGirl2 天前
一个 CSS 属性aspect-ratio
css
xump2 天前
如何在DevTools选中调试一个实时交互才能显示的元素样式
前端·javascript·css
Lhuu(重开版2 天前
CSS:动效布局动画
前端·css