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
Curated Sample HEAD #51
Comments
<meta charset=utf-8>
<meta http-equiv=Content-Type content="text/html; charset=utf-8"> Why put both? As I understood it the first version was standardized in HTML5 because it already worked in older browsers, because parsers looking at the second line will just scan until they find "charset=utf-8". |
Bug in old browser, when you know several dozen of percents of users are still under Xp... May be it's not a bug in browsers but also a bug in some servers. For example, in htaccess you can add About the utf in htaccess, at the time I made this head, google check tool was still crying to have both, one in html and one in htaccess... go figure! |
Seems you're right, just tried this W3C test in a bunch of old and new browsers https://www.w3.org/International/tests/html-css/generate?test=character-encoding-009 Results: https://www.browserstack.com/screenshots/a6ba97653b86cab632a9e6d84a117cc91f7b45f9 But surely then you can drop the HTML5 one and just keep the http-equiv version? |
If I kept both, there is a reason. old-browser, server or site-checker. In the case it was only to make 'well-known' site-checkers happy, it's because some were 'incorrect' and also to make the clients happy to see they are 100% compliant. |
@plexus My head is a summary of all the spaghetti requirements I have found, trying to please all browsers/OS/devices in one single minimum block and to get the best result, e.g. not resize an icon. Even putting all existing meta/link/equiv... in the head would not always give the good results. In the same way, some browsers for one OS can handle items of another OS and/or browser. With just only these 2 requirements, it's impossible to always provide the best solution in all cases, as a worse icon one can be encountered before the best one. Sometimes, I'm wondering how web developers can manage all that mess: css, html,browsers, meta... |
Here some extra info restrictions: http://www.w3.org/TR/html5/document-metadata.html#character-encoding-declaration The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document. In addition, due to a number of restrictions on meta elements, there can only be one meta-based character encoding declaration per document. If an HTML document does not start with a BOM, and its encoding is not explicitly given by Content-Type metadata, and the document is not an iframe srcdoc document, then the character encoding used must be an ASCII-compatible character encoding, and the encoding must be specified using a meta element with a charset attribute or a meta element with an http-equiv attribute in the encoding declaration state. If an HTML document contains a meta element with a charset attribute or a meta element with an http-equiv attribute in the encoding declaration state, then the character encoding used must be an ASCII-compatible character encoding. Doooee... |
Though need to check if it's compatible, correctly supported by all browsers. Hi M$! |
Updated to put IE on top as recommended, google it, based on @joshbuchea note.
|
meta name=keywords is not needed AFAIK. I don't think any search engines use that at all. |
Closing as this is very broad. Thanks for the info & discussion! |
Here is an example of a curated HEAD.
I will give some explanations later or check the respective sites, twitter, fb
NOTE
The text was updated successfully, but these errors were encountered: