

The three levels of HTML5 usage - mathias
http://mathiasbynens.be/notes/html5-levels

======
jamesbritt
First, I had no idea that "/>" had a name. Solidus.

Second, the article is unclear on the "optional" nature of the solidus.

I'm pretty sure that the use of the solidus depends on whether you are using
an HTML or XHTML serialization.

If you are sending the page as content-type text/html, you need to follow HTML
format and leave out the solidus (that is, you follow the same rules as you
would for HTML4).

If you are using the XHTML serialization you need to be using XML syntax and
send the page as application/xml or application/xhtml+xml.

~~~
mathias
Nope, that's the whole point. You’re free to use the solidus in the HTML
serialization of HTML5.

In the XHTML serialization of HTML5, the solidus isn’t _required_ either; you
can choose to close the elements instead.

The following examples are both confirming/valid HTML5 in ‘XML mode’ (they’re
valid XHTML1 as well):

a) With solidus

    
    
        <img src="foo" alt="bar" />
    

b) Without solidus

    
    
        <img src="foo" alt="bar"></img>
    

Just to be clear though, in my post I was just pointing out that you don’t
have to change anything in your HTML4/XHTML code to switch to HTML5, except
for the DOCTYPE.

~~~
jamesbritt
Thanks for the update.

Some additional info here: <http://dev.w3.org/html5/spec/syntax.html#void-
elements>

I'm skeptical about the increased casual nature of what makes for an
acceptable HTML-serialized HTML5 doc. Seems it just makes it that much harder
to write a robust parser and tools. Especially the continued use of empty
attribute syntax, which is just nasty. I understand it's to allow plain old
HTML docs to be acceptable, but still ...

~~~
mathias
Your question inspired me to write a post about XHTML5:
<http://mathiasbynens.be/notes/xhtml5>

