Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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 and read about HTML language mark up 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?

share|improve this question
add comment

3 Answers

It belongs ion the <html> tag:

<html lang="en">
share|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

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.

share|improve this answer
add comment

<meta http-equiv="content-language" content="ll-cc"> what is this

John Conde is correct that it should be included as part of the 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.

share|improve this answer
    
What do you mean "what is this"? –  paulmorriss Sep 18 '12 at 15:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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