Question

What is the main difference between:

<meta charset="UTF-8" />

and

<meta charset="UTF-8">

I understand that this is related to the fact that the tags that are getting /> instead of > don't have closing tags, but what is the benefit of using /> on HTML, PHP and ASP documents?

No correct solution

OTHER TIPS

Not closing tags is now HTML5 valid for void elements (such like img, br...)

<meta charset="UTF-8">

Adding the closing /> is still valid, and in my personal opinion (only personal), it may get deprecated in a near future.

Void elements only have a start tag; end tags must not be specified for void elements.

Reference: W3C

EDIT: Of course, not closing tags is invalid for XHTML

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top