小编Edu*_*fan的帖子

我添加了一个CSS动画,但它不起作用,一切都很好

所以我试着在我网站的链接中添加一个简单的振动动画,但它根本不起作用.有人发现我的代码有问题吗?

我从animista.net上获取了动画代码,然后他们就在那里工作了

这是我的代码:

a {
  text-decoration: none;
  animation: vibrate 1s linear infinite both;
}

@keyframes vibrate {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}
Run Code Online (Sandbox Code Playgroud)
<a href="mailto:me@eduardstefan.com" id="cta">Drop me a line and let’s do cool things together!</a>
Run Code Online (Sandbox Code Playgroud)

html css animation css-animations

-1
推荐指数
1
解决办法
190
查看次数

标签 统计

animation ×1

css ×1

css-animations ×1

html ×1