Which is best? And what is the difference?
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
or
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Another thing, I see that Viewport meta tags and meta http-equiv tags do not get the /> closing tags as charset and other meta tags have…why is that?
Thank you
The second one is better, since it’s more concise. It was standardized that way in HTML5.
As for the tags ending in
/>: It makes no difference what tag it is. No tag has to close like that in HTML5. In the olden days of XHTML, all these tags had to close like that, since XHTML is related to XML.So, the takeaway is thus:
<!DOCTYPE html>– Isn’t that just nice and simple?<meta charset="utf-8">– More concise, more betterererererer…/>