找回密码
 立即注册
查看: 169|回复: 0

前端动画库animate@4.1.1使用

[复制链接]

8

主题

5

回帖

149

积分

注册会员

积分
149
发表于 2022-9-19 21:49:55 | 显示全部楼层 |阅读模式
本帖最后由 lwang 于 2022-9-19 23:43 编辑

使用 npm 安装:
  1. $ npm install animate.css --save
复制代码
或者使用 Yarn 安装(这只适用于适当的工具,如 Webpack、Parcel 等。如果您没有使用任何工具来打包或捆绑代码,您可以简单地使用下面的 CDN 方法):
  1. $ yarn add animate.css
复制代码
将其导入到您的文件中:
  1. import 'animate.css';
复制代码
或者使用 CDN 将其直接添加到您的网页:
  1. <head>
  2.   <link
  3.     rel="stylesheet"
  4.     href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
  5.   />
  6. </head>
复制代码
基本用法
安装 Animate.css 后,将类animate__animated以及任何动画名称添加到元素中(别忘记animate__前缀!)
  1. <h1 class="animate__animated animate__bounce">An animated element</h1>
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|粤嵌技术交流空间

GMT+8, 2025-7-7 17:41 , Processed in 0.671734 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表