It could be an option though.
It could be an option though.
<div/>
some text
will be interpreted as <div>some text</div>
Why? I'm assuming this is "well codified" somewhere, but why?! I would understand if you can't have empty divs, but you can. <div/>
some text
is thus equivalent to <div>
some text
which in the absence of any further tags or content is interpreted as <div>
some text
</div>
(Note however the exception for foreign content like SVG, as noted in the article.) <div/>
some text
and some more text
or <div/>
some text, an <img src="" />, and some more text
or <div/>
some <em>emphasized</em> text
?? A td element's end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.
Edit: I don't know the "div" rules. Don't see that here.Edit2: I'm actually curious on if what I put here is wrong.
So, makes sense that the topic seems different, but it is the explanation for why a div grows to contain everything under it. For example, this is needed to know why the div in the following text closes.
<table>
<tr>
<td>Some cell
<td>Another cell
<tr>
<td>And <div>Another
<tr>
<td>With more stuff.
Right? I get that the original confusion is thinking you can make a self closing div. But the fact that it expands to cover things that come after it requires you to know about the implicit closing. Hard to understand one without understanding the other.Edit: I suppose it would be better for me to say that none of the examples on the immediate parent post are different, because none of them close the div? It isn't that the one div expands to cover everything after it, is that nothing caused it to be closed. Indeed, if those are just snippets from a document, you can't be sure that stuff that comes after it is also not included in the div.
I would tend to agree, which is why I made this suggestion. I think it's much more likely that what was meant is to insert an empty tag, even if that's not how browsers would interpret it.