In order to define charset for HTML5 Doctype, which notation should I use?
Short:
<meta charset="utf-8" />
Long:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
In order to define charset for HTML5 Doctype, which notation should I use?
Short:
<meta charset="utf-8" />
Long:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
was introduced with/for HTML5.As mentioned in the documentation, both are valid. However,
<meta charset="utf-8">
is only for HTML5 (and easier to type/remember).In due time, the old style is bound to become deprecated in the near future. I'd stick to the new
<meta charset="utf-8">
.There's only one way, but up. In tech's case, that's phasing out the old (really, REALLY fast)
Documentation: HTML meta charset Attribute—W3Schools