Can we move the html element's lang attribute to the body?
...should be perfectly valid.
It will DRY things up a bit and help the charset meta element to be within the first 512 bytes if a developer needs to add additional attributes to the html tag(s).
Just looked at the spec and surrounding documentation about @lang ...
This looks legit. I'd be happy with this one. :)
move @lang attribute from HTML elem to BODY. closed by 16e9b7d
I know this is closed and committed, but doesn't it make sense to keep the lang attribute on the <html> element because of the <title> element? That's text people read and search engines crawl.
hixie's preference is for the lang to stay on the HTML tag...
Okay it's a bit redundant but....
How about setting the lang on both <head> and <body> elems?
It works, but wasn't the point of this fix to be more DRY? I would leave well enough alone and keep on html.
@richardcornish: putting it on the html would make it less DRY because of the conditional comments.
Can we put it on head and body tags? Leaving it in the html tag repeats it 4 times rather than 2.
Come to think of it, Content-Language is an acceptable http-header that we may be able to set as a meta tag: <meta http-equiv="Content-Language" content="en">. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12
<meta http-equiv="Content-Language" content="en">
@davidmurdoch There would be two instances of lang="en", but in different places. It would be easier to see it all on <html> at the top, even if it's four times instead of two. It'll depend on your CMS or template system at that point.
I like the <meta> solution because it's document centric instead of element centric. It really makes more sense to declare a language at a document level, then use the lang attribute on more granular elements. Ultimately I would chose whichever method more user agents would support at that point, and I haven't seen one method favored over the other.
I prefer it on html tag than on body for same reasons Hixie mentions.
Divya, how do you feel about using the meta tag?
This is what I wrote about it when I was researching language attributes: http://nimbupani.com/declaring-languages-in-html-5.html
moving lang back to html, also consistent spacing in css. closed by 2a2f1d6
meh, things just got WET.
Yup. they did. But here arent any great solutions here. :/
move @lang attribute from HTML elem to BODY. fixes #286
moving lang back to html, also consistent spacing in css. fixes #286