Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump meta charset to before license #69

Open
ScottFreeCode opened this issue Sep 7, 2022 · 0 comments
Open

Bump meta charset to before license #69

ScottFreeCode opened this issue Sep 7, 2022 · 0 comments

Comments

@ScottFreeCode
Copy link

According to MDN,

<meta> elements which declare a character encoding must be located entirely within the first 1024 bytes of the document.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset

In addition, you should always specify the characterset as early as possible within your HTML's <head> block (within the first kilobyte) …

https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Writing_style_guide/Code_style_guide/HTML#document_characterset

At one point I believe one of these pages noted that browsers essentially have to parse the document enough to find the meta tag with the charset attribute, then stop, throw it out and start over parsing with the specified charset, so the earlier it shows up the better. I don't know if that specific reason is still applicable. I haven't been able to find it again searching MDN's docs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant