Comment by recursive
1 month ago
No. In XHTML, you are required to close your p and li tags. In HTML, the "self-closing" tag is meaningless. That slash doesn't do anything. You can't self-close a <script> or <div> tag. It only appears to work for tags that are don't allow closing.
We aren’t talking about p and li tags which require data to be embedded.
We are talking about self-contained tags such as br.
In XHTML (and XML in general) tags absolutely can be open and closed inside the same tag via the method I described:
Look it up if you don’t believe me. But this is correct.
Are we talking about HTML or XHTML?
In HTML, you can add the slash, but it has no effect. The spec explicitly says that the slash does not close the element. The fact that it's "br" does. So you are allowed to add that slash. But adding it does not close the element.
> On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind.
https://html.spec.whatwg.org/multipage/syntax.html#start-tag...
In XHTML, normal XML rules apply, as you say. That's consistent with what I've said earlier in this thread also.
You’re now talking about HTML again, not XHTML!
Edit 2:
And I’m surprised you even needed to ask because the term “XHTML” has been used consistently. It really shouldn’t be confusing for someone of your obvious technical capabilities
Edit 1:
> In XHTML, normal XML rules apply, as you say. That's consistent with what I've said earlier in this thread also.
Except you haven’t said anything consistently. You keep trying to “educate” people without understanding the point they were making to begin with.
1 reply →