Hacker News new | ask | show | jobs
by brabel 1402 days ago
P is not so special, several HTML tags do not require a closing tag. I think it's even a mistake to close "br", "hr" for example?

Even the MDN docs show "hr" examples without closing: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr

Though they prefer to show "p" with closing tags (they mention it's optional though, and auto-close when one of several other tags are found: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p).

HTML was designed to be written by hand as previous generations of typesetting languages. I think this is the main difference from XML, and this was the reason of a war in the 90's about making HTML a sub-set of XML: see XHTML (https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/XHTM...)

1 comments

hr makes a lot of sense not to close. Does it ever have children?

br too.

p not closing feels a bit like a MS Word pilcro. In that regard I get it.