3 ms·
The same reason <ul> has a closing tag but <li> does not: HTML is SGML where certain tags can be made optional. XML specifically did away with this and made all
by __david__ 12y ago
The same reason <ul> has a closing tag but <li> does not: HTML is SGML where certain tags can be made optional. XML specifically did away with this and made all close tags mandatory (even on contentless tags, which is why xhtml requires you to do <img />).
- Touche 12y agoJust to be clear, are some closing tags optional or are all closing tags optional? If the former, how do you know which?
- justincormack 12y agoYou work it out from the schema - if it is not ambiguous you can omit it.
- Tuna-Fish 12y agoIn this case, the schema probably disallows any other tags inside <line>, which makes </line> superfluous and it can thus be omitted. If <stanza>s are not recursive and poems cannot contain <line>s outside <stanza>s, </stanza> can also be omitted. Etc etc.