3 ms·
According to the specs the <html> tag can be fully omitted. From MDN [1]: > The start tag may be omitted if the first thing inside the <html> element is not a
by pilaf 2y ago
According to the specs the <html> tag can be fully omitted. From MDN [1]:
> The start tag may be omitted if the first thing inside the <html> element is not a comment.
> The end tag may be omitted if the <html> element is not immediately followed by a comment.
1: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html#technical_summary https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ht...
- AndyKelley 2y agoSuperHTML README says: > This language server is stricter than the HTML spec whenever it would prevent potential human errors from being reported. If your goal is to output minimal HTML, let a tool automate that. Forgetting to open <html> is more likely a mistake than shorthand, and as shorthand it's not valuable.
- roelschroeven 2y agoI knew that that the <html> tag can be fully omitted (and some others, like <body> and <title> IIRC), but if I read that it can also be partially omitted. So you're allowed to open it but not close it, or close it but don't open it. That's new to me. I've tried omitting those tags, but I decided that in the end things are easier to read when you do include them, so nowadays I always include them when I write HTML.