Lots of web sites uses following meta tag to specify the default language of the document:

<meta http-equiv="content-language" content="es-ES">

When I go to w3c site:

http://www.w3.org/TR/2011/WD-html-markup-20110113/meta.http-equiv.content-language.html#meta.http-equiv.content-language

I get this:

Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.

What is the way of specifying document language now?

link|improve this question

73% accept rate
feedback

2 Answers

It belongs ion the <html> tag:

<html lang="en">
link|improve this answer
thanks! should we always use Two Letter ISO Language Name? or can we use something like this: en-US? – tugberk Nov 28 '11 at 14:31
It is defined here in details: w3.org/TR/html4/struct/dirlang.html – tugberk Nov 28 '11 at 14:33
The spec document for what is acceptable is quite long and I haven't read it, but based on the examples I have seen it appears that the two letter ISO language is the only acceptable value. If I'm wrong hopefully someone will point it out. – John Conde Nov 28 '11 at 14:35
The information here should be correct, right? w3.org/TR/html4/struct/dirlang.html#langcodes – tugberk Nov 28 '11 at 14:37
1  
Only if you're using HTML4. HTML5's specs are different. – John Conde Nov 28 '11 at 14:37
show 1 more comment
feedback

The full answer to the question is answered by the W3C here: http://www.w3.org/International/questions/qa-http-and-lang.en

@John Conde is correct that it should be included as part of the <html> tag, but there's also the important consideration of ensuring that it's included as part of the HTTP Headers.

Most Meta elements are redundant replacements or over-rides for information that should be sent as part of the HTTP request and response.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.