|
|
|
|
|
by kristopolous
1402 days ago
|
|
That's in spec for the time. HTML 2.0 draft 00, November 1994: "2.14.1 Paragraph <P>
Level 0
The Paragraph element indicates a paragraph. The exact
indentation, leading, etc. of a paragraph is not defined
and may be a function of other tags, style sheets, etc.
Typically, paragraphs are surrounded by a vertical space
of one line or half a line. This is typically not the
case within the Address element and or is never the case
within the Preformatted Text element. With some HTML
user agents, the first line in a paragraph is indented.
Example of use:
<H1>This Heading Precedes the Paragraph</H1>
<P>This is the text of the first paragraph.
<P>This is the text of the second paragraph. Although you
do not need to start paragraphs on new lines, maintaining
this convention facilitates document maintenance.
<P>This is the text of a third paragraph.
"https://datatracker.ietf.org/doc/html/draft-ietf-html-spec-0... This is still "true". You can't embed a <P> in another <P>. It's special that way. I've never tried it using JS with just an addChild though, I wonder what would happen... |
|
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...)