<br/>This non-closing talisman means that <div/> or <script/> are not closed, and will mess up nesting of elements.
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:
<br/>
Look it up if you don’t believe me. But this is correct.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.
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.
The original post also covers both. It seems at some point one of us was talking about one of them and the other assumed it was the other.
I thought I understood the point being made, but maybe not.
> if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/)
If you're going to be pedantic, at least be correct about it.
[1]: https://html.spec.whatwg.org/multipage/syntax.html#start-tag...
> On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser.
(The void elements are listed here: https://developer.mozilla.org/en-US/docs/Glossary/Void_eleme... )
> 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...