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

Viewed 7897

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

3 Answers

No, technically using a self-closing <div/> tag is invalid HTML5. Using <div></div> works fine.

Related