What fresh hell is THIS now? - Patrick Lauke
[jpdevries] Does anyone have any opinions on if the spec should add lang
attribute to <html>
in examples? http://j4p.us/2O3s3M0f3p2B/Screen%20Shot%202017-04-04%20at%207.06.25%20PM.png
I work for a online coding bootcamp, and I’m trying to get our examples to contain best practices, even if those best practices aren’t what is being conveyed…but it is difficult to push for that when resources like the spec itself does not.
I can understand both sides. In the words of my late Father, we could say “do as I say, not as I do” and not worry if all our examples are bulletproof. On the other hand, I think it is important to not spread poor practices.
[higley] @jpdevries yes, lang
should always be included on the <html>
tag, and on any other tags that contain text in a different language. It is actually part of WCAG spec (https://www.w3.org/TR/2008/REC-WCAG20-20081211/#meaning-doc-lang-id).
Screen readers can use it to help determine what voice and pronunciation to use. I haven’t actually tried this so someone else may need to confirm, but my impression is if someone using a screen reader in another language were to land on an English-language page without lang
set, they would get improper pronunciation.
The other more obvious use of lang
is for internationalization: https://www.w3.org/International/questions/qa-lang-why
[jpdevries] @higley Thanks! Speaking of
Screen readers can use it to help determine what voice and pronunciation to use.
https://github.com/TryGhost/Casper/issues/286#issuecomment-281950302
<html lang>
makes me think about something I saw in a Google style guide somewhere. It seemed like really bad advise. It recommended that to save on bytes, you don’t include <html>
or even <head>
. Just go straight to the body :\
h3