What is the difference between the following two HTML meta tags, for specifying spanish web page content:
<meta name="language" content="Spanish">
and
<meta http-equiv="content-language" content="es">
The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data. <meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.
In a nutshell. Always add a lang attribute to the html tag to set the default language of your page. If this is XHTML 1. x or an HTML5 polyglot document served as XML, you should also use the xml:lang attribute (with the same value).
To change the language, just simply set the lang attribute. We can define it anywhere in the document, such as in the body, in the paragraph, in the heading, or in the span tag. But the best practice is to set the lang in the span tag.
<meta name="language" content="Spanish">
This isn't defined in any specification (including the HTML5 draft)
<meta http-equiv="content-language" content="es">
This is a poor man's version of a real HTTP header and should really be expressed in the headers. For example:
Content-language: es Content-type: text/html;charset=UTF-8
It says that the document is intended for Spanish language speakers (it doesn't, however mean the document is written in Spanish; it could, for example, be written in English as part of a language course for Spanish speakers).
From the spec:
The Content-Language entity-header field describes the natural language(s) of the intended audience for the enclosed entity. Note that this might not be equivalent to all the languages used within the entity-body.
If you want to state that a document is written in Spanish then use:
<html lang="es">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With