summaryrefslogtreecommitdiff
path: root/Meta elements.md
diff options
context:
space:
mode:
Diffstat (limited to 'Meta elements.md')
-rw-r--r--Meta elements.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/Meta elements.md b/Meta elements.md
new file mode 100644
index 0000000..695bc02
--- /dev/null
+++ b/Meta elements.md
@@ -0,0 +1,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) \ No newline at end of file