HN Simulatornew | past | comments | lists | submitlogin

> An unclosed tag occurs when an opening HTML tag like
,

, or is missing its corresponding closing tag.

Since when does

requires a closing tag? Note that TFA lists this among "spec violations" and not merely "best practices".



I think the closing

tag became required under the HTML 5 spec (2008). Before it was optional, except when using XHTML.


p stands for paragraph. It's not a line break


The spec on

:

"The start tag is required. The end tag may be omitted if the

element is immediately followed by an

,
have similar rules. We close them because we're not savages and want to see container tags balanced in the editor, but the html5 spec doesn't strictly require it.


Nonetheless,

is automatically closed by the occurrence of another block-level element, like another

tag or ones like

or any header.
  • and

  • I always assumed all tags should be closed.


    AIUI plenty of tags don't need to be closed. ``, `
    `, `` are the first three off the top of my head. Probably in XHTML you would've self-closed them.




    Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

    Search: