4 ms·
I was going to say this! Moreover, besides self-closing tags, in HTML5 there are many optional tags. For example, you almost never need to write explicit html
by enriquto 4y ago
I was going to say this! Moreover, besides self-closing tags, in HTML5 there are many optional tags. For example, you almost never need to write explicit html, head, body, tags. The given minimal example thus can be simplified to something like this:
<!DOCTYPE html>
<title>Example Webpage</title>
<h1>Welcome to my webpage</h1>
<p>This is some content!
...and still be correct, 100% conformant html. See google's html style guide for more cool hints towards a minimal markup: https://google.github.io/styleguide/htmlcssguide.html https://google.github.io/styleguide/htmlcssguide.html
I agree with your remark regarding the redundancy of markdown. It makes almost no difference to write markdown or html5 by hand. If people knew this, it would seem they would replace their "markdown engines" with cat (to put the header to each page), or simply with nothing at all.
- skyfaller 4y agoAnother source explaining optional HTML in depth: https://meiert.com/en/blog/optional-html/ https://meiert.com/en/blog/optional-html/
- tannhaeuser 4y ago> Moreover, besides self-closing tags, in HTML5 there are many optional tags. Those are (rooted in) SGML elements having start-element tag omission allowed, whereas HTML's "self-closing tags" (in HTML5 parlance) correspond to elements having end-element tag omission allowed. In your example, SGML infers the missing tags for html, head, body, and p to arrive at the canonical form: <html> <head> <title>Example Webpage</title> </head> <body> <h1>Welcome to my webpage</h1> <p>This is some content!</p> </body> </html> Cf. http://sgmljs.net/blog/blog1701.html http://sgmljs.net/blog/blog1701.html (the TALK slides) explaining the inferences SGML does on the example input in detail