I’m confused as to whether or not meta tags should be closed or not in HTML5. It seems like it should be and HTML5Doctor.com does this, but most other sites done by well known developers do not close it.
If you are writing HTML, you do not need to self-close any elements. Spot elements, such as <img>, <meta>, <link>, <br> etc remain as spot elements, just as they were in earlier forms of HTML.
If you are writing XHTML, all elements need to be closed, and this can either be done by <meta …></meta> (which won’t work on a lot of older browsers) or <meta … /> (which will).
Keeping things simple, their both correct. I always self-close elements because I prefer the XHTML method of syntax (and the refusal to allow errors), but using conventional classic HTML non-closed code is equally valid, just be sure you’re consistent with whatever you use and it shouldn’t be too much of an issue.
I highly discourage using the XML Doctype in XHTML as older versions of IE (6 especially) will trigger quirks mode and make your entire design fall to it’s feet.
Of course if you are actually going to use XHTML then that IE6 issue doesn’t apply since the only version of IE to support XHTML so far is IE9.
Also you really shouldn’t have the space before the /> if you are going to use XHTML syntax since served as XHTML it is completely unnecessary and if served as HTML it only causes issues in Netscape 4 and earlier browsers.
Well technically Internet Explorer defeats the whole purpose of XHTML so unless you want to sacrifice a huge proportion of your audience who use IE6-8, 99% of all the XHTML being implemented on the web is done so in such a way that it’s invalid, incompatible or pointless, so it’s a losing battle
It defeats the whole purpose of HTML 5 as well since IE10 is going to be the earliest version of IE that can possibly support that properly - IE9 can at best support it as well as IE5 supported CSS 2 - with all the same potential problems that caused.