Post ASuuP0JlkaYVEfNTJQ by tbroyer@piaille.fr
(DIR) More posts by tbroyer@piaille.fr
(DIR) Post #ASuh14OZdk8zWlsjuy by vanilla@social.spicyweb.dev
2023-02-21T19:07:17Z
0 likes, 0 repeats
What's your preference:Slash or no slash on "void" elements? #HTML #WebDev
(DIR) Post #ASuhXXDA2S6WAJ1Y6S by Jeremiah@alpaca.gold
2023-02-21T19:13:12Z
0 likes, 0 repeats
@vanilla There is an authoritative correct answer to this: no slash on void elements.https://github.com/validator/validator/wiki/Markup-%C2%BB-Void-elements#promoting-the-right-mental-model-for-void-elements
(DIR) Post #ASui9ePFjgpVU5r4W8 by anniegreens@social.lol
2023-02-21T19:20:05Z
0 likes, 0 repeats
@vanilla ooh this is triggering! I still fight with myself over this but I answered with `<br>` going by what I have written most recently
(DIR) Post #ASuiNWOGKt2Cg40QN6 by n1k0@mamot.fr
2023-02-21T19:22:27Z
0 likes, 0 repeats
@vanilla Void elements? which GnR album is this? 🥁@nhoizey
(DIR) Post #ASulAsOvUNq52YyibQ by erikvanbeek@mastodon.nl
2023-02-21T19:53:53Z
0 likes, 0 repeats
@vanilla my SGML is a little rusty so I add the slash
(DIR) Post #ASumhILodxhAk8XtUe by lene@front-end.social
2023-02-21T20:10:56Z
0 likes, 0 repeats
@vanilla I'm generation XHTML
(DIR) Post #ASupMvuGgHujCiduO8 by caludio@mastodon.social
2023-02-21T20:40:54Z
0 likes, 0 repeats
@vanilla But that space before the slash? https://claudio.cica.li/posts/2022/self-closing-tags/:)
(DIR) Post #ASuqIR6xKrK8UQzsbw by vintprox@techhub.social
2023-02-21T20:51:16Z
0 likes, 0 repeats
@vanilla Today's #HTML parser needs to account for a lot of shit it doesn't need to make exceptions for, including the knowledge of tags being "void". #XHTML all the way!
(DIR) Post #ASuqcASsw4YAebfA5Q by GoOz@mamot.fr
2023-02-21T20:54:51Z
0 likes, 0 repeats
@vanilla So I know HTML5 doesn't need it so I don't use the slash anymore. But It's still required in XML based file such as SVG.So it made me wonder, does the SVG's <use> tag still need the slash if it's inside an HTML5 document? 🤔
(DIR) Post #ASuuP0JlkaYVEfNTJQ by tbroyer@piaille.fr
2023-02-21T21:37:15Z
0 likes, 0 repeats
@vanilla HTML is not XML: no slash on void elements, omit (some) optional tags, omit quotes on attribute values that don't need them.
(DIR) Post #ASuwmHO4eWTmkCcLDs by vanilla@social.spicyweb.dev
2023-02-21T22:03:57Z
0 likes, 0 repeats
@caludio Fascinating bit of history!
(DIR) Post #ASuxC4OjZM6ZzIDwkS by vintprox@techhub.social
2023-02-21T21:55:08Z
0 likes, 0 repeats
@GoOz @vanilla Dunno about inline SVG in HTML. But if you type <custom-element /> (with a slash), heavily implying that it can be a "void" tag, it just will break HTML in the browser.
(DIR) Post #ASuxC4tvhN3hY2orNA by GoOz@mamot.fr
2023-02-21T21:57:20Z
0 likes, 1 repeats
@vintprox @vanilla Long story short, SVG tag in a inline SVG do need the slash in a HTML5 document. I tested on a website of mine and it broke stuff when I removed them :)
(DIR) Post #ASv0F1ORUrihOrBdFA by lewishazell@hachyderm.io
2023-02-21T22:42:42Z
0 likes, 0 repeats
@vanilla Depends if it's HTML or XHTML :)
(DIR) Post #ASyfzMf9QdgwHX6AEq by vanilla@social.spicyweb.dev
2023-02-23T17:14:36Z
0 likes, 0 repeats
With only a day left and almost 200 votes in, the slash version has pulled ahead at nearly 2:1. Perhaps the ghost of XHTML past still lingers among us… 👻