<div /> is not an empty div in HTML5
saw some discussion on twitter about this blog post
and i haven't decided if i agree with the opinions but i am definitely having a hard time making my peace with this:
<input />This text is outside the input.
<input>This text is outside the input.</input>
<div>This text is inside the div.</div>
<div />This text is inside the div.Why did anyone ever think this was okay? For what conceivable reason did anyone sign off on this bullshit?
I was just complaining earlier about worse-is-better, and this is the exact sort of worse that worse-is-better defends. If I let the brain worms take me and I forget that better things are possible, would I be able to rationalize bullshit like this? If I Nuance™ myself into thinking bad things are good, would I be happy?
- HTML was originally (kinda) an SGML language. SGML was ridiculously over-complicated, so nobody actually implemented it properly, but it was also kinda a "formating commands" language. This whole tree structure bullshit is a modern invention, comparatively. Having null tags (those without children, like
<img>and<input>) wasn't very weird. - Somebody squinted really hard at SGML and invented XML from what they thought they saw. Self-closing tags (
<div />) came from SGML's "short tags" feature where you could write a tag like<div/to imply the end tag. (Note the lack of>!) - XML IS THE FUTURE ALL MUST BE XML, Jake's article basically explains what went on here.
- When you've got a trillion documents (not exaggerating that number) in some bizarre bastard syntax, "just document what's out there" starts looking really attractive, for good reason.
