New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move lang attribute from html to body #286

Closed
davidmurdoch opened this Issue Jan 19, 2011 · 14 comments

Comments

Projects
None yet
4 participants
@davidmurdoch
Contributor

davidmurdoch commented Jan 19, 2011

Can we move the html element's lang attribute to the body?

I don't think we need to specify the (human) language of our css and javascript resources.

<body lang="en"></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).

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Jan 19, 2011

Member

Just looked at the spec and surrounding documentation about @lang ...

This looks legit. I'd be happy with this one. :)

good call.

Member

paulirish commented Jan 19, 2011

Just looked at the spec and surrounding documentation about @lang ...

This looks legit. I'd be happy with this one. :)

good call.

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Jan 20, 2011

Member

move @lang attribute from HTML elem to BODY. closed by 16e9b7d

thx davidmurdoch

Member

paulirish commented Jan 20, 2011

move @lang attribute from HTML elem to BODY. closed by 16e9b7d

thx davidmurdoch

@richardcornish

This comment has been minimized.

Show comment
Hide comment
@richardcornish

richardcornish Jan 21, 2011

Contributor

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.

Contributor

richardcornish commented Jan 21, 2011

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.

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Jan 22, 2011

Member

hixie's preference is for the lang to stay on the HTML tag...

reopening... :/

Member

paulirish commented Jan 22, 2011

hixie's preference is for the lang to stay on the HTML tag...

reopening... :/

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Jan 23, 2011

Member

Okay it's a bit redundant but....
How about setting the lang on both <head> and <body> elems?

Member

paulirish commented Jan 23, 2011

Okay it's a bit redundant but....
How about setting the lang on both <head> and <body> elems?

@richardcornish

This comment has been minimized.

Show comment
Hide comment
@richardcornish

richardcornish Jan 23, 2011

Contributor

It works, but wasn't the point of this fix to be more DRY? I would leave well enough alone and keep on html.

Contributor

richardcornish commented Jan 23, 2011

It works, but wasn't the point of this fix to be more DRY? I would leave well enough alone and keep on html.

@davidmurdoch

This comment has been minimized.

Show comment
Hide comment
@davidmurdoch

davidmurdoch Jan 24, 2011

Contributor

@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

Contributor

davidmurdoch commented Jan 24, 2011

@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

@richardcornish

This comment has been minimized.

Show comment
Hide comment
@richardcornish

richardcornish Jan 24, 2011

Contributor

@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.

Contributor

richardcornish commented Jan 24, 2011

@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.

@nimbupani

This comment has been minimized.

Show comment
Hide comment
@nimbupani

nimbupani Jan 25, 2011

Member

I prefer it on html tag than on body for same reasons Hixie mentions.

Member

nimbupani commented Jan 25, 2011

I prefer it on html tag than on body for same reasons Hixie mentions.

@davidmurdoch

This comment has been minimized.

Show comment
Hide comment
@davidmurdoch

davidmurdoch Jan 25, 2011

Contributor

Divya, how do you feel about using the meta tag?

Contributor

davidmurdoch commented Jan 25, 2011

Divya, how do you feel about using the meta tag?

@nimbupani

This comment has been minimized.

Show comment
Hide comment
@nimbupani

nimbupani Jan 25, 2011

Member

This is what I wrote about it when I was researching language attributes: http://nimbupani.com/declaring-languages-in-html-5.html

Member

nimbupani commented Jan 25, 2011

This is what I wrote about it when I was researching language attributes: http://nimbupani.com/declaring-languages-in-html-5.html

@nimbupani

This comment has been minimized.

Show comment
Hide comment
@nimbupani

nimbupani Mar 1, 2011

Member

moving lang back to html, also consistent spacing in css. closed by 2a2f1d6

Member

nimbupani commented Mar 1, 2011

moving lang back to html, also consistent spacing in css. closed by 2a2f1d6

@davidmurdoch

This comment has been minimized.

Show comment
Hide comment
@davidmurdoch

davidmurdoch Mar 1, 2011

Contributor

meh, things just got WET.

Contributor

davidmurdoch commented Mar 1, 2011

meh, things just got WET.

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 1, 2011

Member

Yup. they did. But here arent any great solutions here. :/

Member

paulirish commented Mar 1, 2011

Yup. they did. But here arent any great solutions here. :/

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment