recommend using SRI hashes and `crossover` attributes (#647)

This commit is contained in:
Mithgol 2017-07-10 23:11:44 +03:00 committed by Elton Mesquita
parent 23787fcc49
commit c420b285ce
1 changed files with 12 additions and 2 deletions

View File

@ -24,10 +24,20 @@ $ npm install animate.css --save
<link rel="stylesheet" href="animate.min.css">
</head>
```
or use the version hosted by [CDNJS](https://cdnjs.com/libraries/animate.css)
Instead of installing you may use the remote version (hosted by [CDNJS](https://cdnjs.com/libraries/animate.css)):
```html
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
</head>
```
You may [generate a SRI hash](https://www.srihash.org/) of that particular version and then use it to ensure the file's integrity; also you can make anonymous requests to CDN by setting the corresponding [`crossorigin`](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) attribute:
```html
<head>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css"
integrity="sha384-OHBBOqpYHNsIqQy8hL1U+8OXf9hH6QRxi0+EODezv82DfnZoV7qoHAZDwMwEJvSw"
crossorigin="anonymous">
</head>
```
2. Add the class `animated` to the element you want to animate.