summaryrefslogtreecommitdiff
path: root/Meta elements.md
blob: 695bc025d43ebcf8f40401cc81e34a6f7c609bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
tags:
  - html
  - web
---
`content` attribute required

Pragma directive: `http-equiv` attribute (its value is pragma directive)
Named: `name` attribute.

# Pragma directive
[7 defined](https://html.spec.whatwg.org/multipage/semantics.html#pragma-directives) 

most useful:
`<meta http-equiv="content-security-policy" content="default-src https:" />`
[content values](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy)

Specify allowed server origins and script endpoints, protecting against cross site scripting attacks.

# Named
- keywords; obsolete due to snake-oil salespeople
- description; useful for SEO
- robots
	- `content="noindex, nofollow"`
	- `content="index, follow"`

### OpenGraph
[Protocol](https://ogp.me/)

Control how social media sites display links.
Have a `property` attr instead of `name`.

Facebook media card:
```
<meta property="og:title" content="Machine Learning Workshop" />
<meta property="og:description" content="School for Machines Who Can't Learn Good and Want to Do Other Stuff Good Too" />
<meta property="og:image" content="http://www.machinelearningworkshop.com/image/all.png" />
<meta property="og:image:alt" content="Black and white line drawing of refrigerator, french door refrigerator, range, washer, fan, microwave, vaccuum, space heater and air conditioner" />
```

Twitter uses something else: [Twitter card markup](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup)