In today's adventures of finding out weird things you can do with HTML…
You should not put a `<style>` element anywhere other than the `<head>`
So `<body><style> ...CSS...</style></body>` is an error. (It works, because browsers are tolerant.)
But you *can* put a `<link rel="stylesheet">` element in a body.
Obviously, that needs an *external* data source for the CSS.
So you can cheat by Base64 encoding it!
`<body><link rel="stylesheet" type="text/css" href="data:text/css;base64,LyoqCi…">`
In this article, Louis Lazaris describes and demonstrates some interesting HTML attributes that you may or may not have heard of and perhaps find useful enough to personally use in one of your projects.
TIL that you no longer have to write <a target=“_blank” rel=“noopener”> to make external links secure!
The HTML standard was changed in 2019 so that rel=“noopener” is always implied: github.com/whatwg/html/pu…
thanks to the @jaffathecake and @DasSurma’s podcast for this tidbit!
Are you still asking your users to 'Right click and “Save As…”'? Use the anchor `download` attribute instead.
🔥 Better UX
✨ lets you specify the suggested filename
☎ Works on Android
⚠️ Image must be on same origin
Learn more: developer.mozilla.org/en-US/docs/Web…