Re:Only 2.6% of the most visited websites have fully valid HTML
by francisofascii on Wednesday August 12, 2026 @11:42AM
(#49274219)
I think the closing </p> tag became required under the HTML 5 spec (2008). Before it was optional, except when using XHTML.
Re:Only 2.6% of the most visited websites have fully valid HTML
by NooneAtAll3 on Wednesday August 12, 2026 @11:27AM
(#49273930)
p stands for paragraph. It's not a line break
Re:Only 2.6% of the most visited websites have fully valid HTML
by ahakki on Wednesday August 12, 2026 @11:33AM
(#49274039)
The spec on <p>:
"The start tag is required. The end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <details>, <div>, <dl>, <fieldset>, <figcaption>, <figure>, <footer>, <form>, h1, h2, h3, h4, h5, h6, <header>, <hgroup>, <hr>, <main>, <menu>, <nav>, <ol>, <pre>, <search>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a>, <audio>, <del>, <ins>, <map>, <noscript> or <video> element, or an autonomous custom element." [0][1]
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
Re:Only 2.6% of the most visited websites have fully valid HTML
by chuckadams on Wednesday August 12, 2026 @11:33AM
(#49274053)
Nonetheless, <p> is automatically closed by the occurrence of another block-level element, like another <p> tag or ones like <div> or any header. <li> and <tr> 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.
Re:Only 2.6% of the most visited websites have fully valid HTML
by elAhmo on Wednesday August 12, 2026 @11:30AM
(#49273990)
I always assumed all tags should be closed.
Re:Only 2.6% of the most visited websites have fully valid HTML
by darrenf on Wednesday August 12, 2026 @11:43AM
(#49274228)
AIUI plenty of tags don't need to be closed. `<input>`, `<hr>`, `<img>` are the first three off the top of my head. Probably in XHTML you would've self-closed them.
Re:Only 2.6% of the most visited websites have fully valid HTML
by account42 on Thursday August 13, 2026 @03:53AM
(#49282930)
Those are different from <p> as they are always self-closing immediately and thus cannot even be manually closed. <p> is only automatically closed if there is no </p> before the next block element.
Since when does <p> requires a closing tag? Note that TFA lists this among "spec violations" and not merely "best practices".