Ryan
Ryan

Reputation: 6055

Consequences of not using a lang attribute in an html5 html tag

If at the start of my html5 doc I simply use:

<!DOCTYPE html><html>

how will my site be at a disadvantage for not using something like:

<!DOCTYPE html><html lang="en">

Upvotes: 19

Views: 4101

Answers (1)

No Results Found
No Results Found

Reputation: 102745

Good question, but I think most of what you want to know is simple reference:

http://www.w3.org/TR/html4/struct/dirlang.html

Some highlights:

Language information specified via the lang attribute may be used by a user agent to control rendering in a variety of ways. Some situations where author-supplied language information may be helpful include:

  • Assisting search engines
  • Assisting speech synthesizers
  • Helping a user agent select glyph variants for high quality typography
  • Helping a user agent choose a set of quotation marks
  • Helping a user agent make decisions about hyphenation, ligatures, and spacing
  • Assisting spell checkers and grammar checkers

I don't believe there are any important differences between HTML4 and HTML5 regarding this.

Upvotes: 15

Related Questions