diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-05-06 23:09:23 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-05-06 23:09:23 +0200 |
commit | 78211f96953bc1a63570f2430cee4ad92c841ce4 (patch) | |
tree | 614db0456636442c7ef250f106f9f8b1d04e01e6 /Meta elements.md | |
parent | bb5c734d7445097e94c4a602f5ce066a836dbead (diff) |
vault backup: 2025-05-06 23:09:23
Diffstat (limited to 'Meta elements.md')
-rw-r--r-- | Meta elements.md | 41 |
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 |