Is it valid HTML5 to use a single tag for a div?

html, xhtml

Solution

This is not valid HTML 5 (HTML does not allow shorttags, the equivalent HTML construct is a single opening `div` tag). It is valid XHTML 5, as it is valid XML.

The reason why you might see this pass through a validator just fine is because of what you stated:

PS: I'm serving page as application/xhtml+xml

Which means that you tell the validator that it must treat your markup as XML. In other words your page is not HTML 5 at all.

Problem

For example: `<div/>` instead of `<div></div>`. I did this and apparently the HTML5 validator passed this as valid. I was wondering it this is actually true? PS: I'm serving page as application/xhtml+xml

Original source