Terence Eden on Nostr: In today's adventures of finding out weird things you can do with HTML… You should ...
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…">`
Published at
2024-08-18 09:57:57Event JSON
{
"id": "72047fbf5c32d5e2975e39b2770e6a9fbf6ba5bad88f96ce5156f18de71b58af",
"pubkey": "350b4da116bd4aa32feaa4d36a4aa69b544e430946c2a9fa1ac43b3342652b3e",
"created_at": 1723975077,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@Edent/112982430677398237",
"web"
],
[
"proxy",
"https://mastodon.social/users/Edent/statuses/112982430677398237",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/Edent/statuses/112982430677398237",
"pink.momostr"
],
[
"-"
]
],
"content": "In today's adventures of finding out weird things you can do with HTML…\n\nYou should not put a `\u003cstyle\u003e` element anywhere other than the `\u003chead\u003e`\n\nSo `\u003cbody\u003e\u003cstyle\u003e ...CSS...\u003c/style\u003e\u003c/body\u003e` is an error. (It works, because browsers are tolerant.)\n\nBut you *can* put a `\u003clink rel=\"stylesheet\"\u003e` element in a body. \n\nObviously, that needs an *external* data source for the CSS.\n\nSo you can cheat by Base64 encoding it!\n\n`\u003cbody\u003e\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"data:text/css;base64,LyoqCi…\"\u003e`",
"sig": "cd10fae0df19153d0829438ca27ab2e6bc5d0860650d97e2f65bac0980ac8c4bc711bb0c8b5d5c9d31e084e24e6f27c55de7c03c71cb920e88321646e6ed695c"
}