Skip to content

Commit c420b28

Browse files
Mithgoleltonmesquita
authored andcommitted
recommend using SRI hashes and crossover attributes (#647)
1 parent 23787fc commit c420b28

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@ $ npm install animate.css --save
2424
<link rel="stylesheet" href="animate.min.css">
2525
</head>
2626
```
27-
or use the version hosted by [CDNJS](https://cdnjs.com/libraries/animate.css)
27+
Instead of installing you may use the remote version (hosted by [CDNJS](https://cdnjs.com/libraries/animate.css)):
2828
```html
2929
<head>
30-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
30+
<link rel="stylesheet"
31+
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
32+
</head>
33+
```
34+
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:
35+
```html
36+
<head>
37+
<link rel="stylesheet"
38+
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css"
39+
integrity="sha384-OHBBOqpYHNsIqQy8hL1U+8OXf9hH6QRxi0+EODezv82DfnZoV7qoHAZDwMwEJvSw"
40+
crossorigin="anonymous">
3141
</head>
3242
```
3343
2. Add the class `animated` to the element you want to animate.

0 commit comments

Comments
 (0)