HTML meta tag for content language

后端 未结 5 1300
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 17:51

What is the difference between the following two HTML meta tags, for specifying spanish web page content:


         


        
5条回答
  •  醉话见心
    2020-12-12 18:28

    You asked for differences, but you can’t quite compare those two.

    Note that is obsolete and removed in HTML5. It was used to specify “a document-wide default language”, with its http-equiv attribute making it a pragma directive (which simulates an HTTP response header like Content-Language that hasn’t been sent from the server, since it cannot override a real one).

    Regarding , you hardly find any reliable information. It’s non-standard and was probably invented as a SEO makeshift.

    However, the HTML5 W3C Recommendation encourages authors to use the lang attribute on html root elements (attribute values must be valid BCP 47 language tags):

    Anyway, if you want to specify the content language to instruct search engine robots, you should consider this quote from Google Search Console Help on multilingual sites:

    Google uses only the visible content of your page to determine its language. We don’t use any code-level language information such as lang attributes.

提交回复
热议问题