Bad value google for attribute name on element met

2019-05-11 09:24发布

问题:

Is there an alternative for HTML5 for google notranslate meta tag. I getting the error below when validating HTML5.

Bad value google for attribute name on element meta: Keyword google is not registered. <meta name="google" content="notranslate" />

回答1:

The keyword google is registered at http://wiki.whatwg.org/wiki/MetaExtensions#Registered_Extensions:

A content of notranslate will tell google not to pop up the translate bar / link if the page is in a foreign language form the user's browser.

<meta name="google" content="notranslate">

So it is valid to use this keyword in HTML5. If a validator reports this as an error, the validator is probably not up to date or simply wrong.



回答2:

The right way to do this for html5 is:

<html translate="no">
...
</html>

W3 says it should not be Google specific