4 ms·
That's not what foreign elements are. If you click the link to "foreign elements" in your first link, you'll see that the spec[1] defines foreign elements as "E
by AgentConundrum 14y ago
That's not what foreign elements are. If you click the link to "foreign elements" in your first link, you'll see that the spec[1] defines foreign elements as "Elements from the MathML namespace and the SVG namespace." In other words, elements which are foreign to HTML.
The <div> element is a "normal element", and the spec doesn't seem to indicate what to do with the slash/solidus on normal elements, only on void or foreign ones.
I got my information for my previous comment from an answer on StackOverflow[2], but the w3c's validator seems to back it up. The OP has been changed to use the explicit close tag on that element, so you'll have to edit the source to use the (non-)self-closing version to check it yourself, but it kicked up errors for me.
Specifically, the error given read "Self-closing syntax (/>) used on a non-void HTML element. Ignoring the slash and treating as a start tag." This is what I said in my previous comment, albeit much more succinctly.
As for your second comment, regarding the space before the slash, I don't understand its relevance to my comment. I said nothing about the space in the element; I only referred to the effect of the slash. Also, you're talking about XHTML, and linking to its spec, in a discussion regarding HTML5. If I'm missing your point, please clarify.
[1] http://dev.w3.org/html5/spec/single-page.html#elements-0 http://dev.w3.org/html5/spec/single-page.html#elements-0
[2] http://stackoverflow.com/a/3558200/1588 http://stackoverflow.com/a/3558200/1588
[3] http://validator.w3.org/#validate_by_input http://validator.w3.org/#validate_by_input
- taylorfausak 14y agoI linked to the HTML spec because it explains that the slash only means something for void or foreign elements. The <div> element is neither, so the slash is either interpreted as an attribute or ignored. You are correct, both in this comment and the previous one; I was agreeing with you and providing sources. My comment about the spaces was trivia on top of your trivia. I thought it was relevant because all of your examples of self-closing tags had a space.
- AgentConundrum 14y agoAh, well in that case I certainly apologize. I inferred a tone from your comment which you didn't intend to be there.