These attributes facilitate the rendering of documents that use multiple
languages or character sets - especially bi-directional language situations.
This attribute category draws its inspiration from a
in HTML 4.x called "%i18n" (short for "internationalization" - 'i',
followed by 18 letters in between, followed by 'n'.) The HTML 4.x
category includes only the "dir" and "lang" attributes.
The other attribute in the "Language" category on this site (called,
curiously enough, "language") is IE-specific and indicates the
scripting language in use for the element. Although this attribute
deals with a computer language rather than human languages as the other
two attributes do, the common grouping made sense (to me.)
This attribute is used to indicate the directionality of the flow of
the content for the current element. This becomes most helpful in
bi-directional language scenarios where intrinsic dimension may be
ambiguous. On block elements, this attribute indicates the base
directionality of the text in the block. For inline elements this
attribute starts a new embedding level for direction-dependent content.
If this attribute is omitted for an inline element, a new embedding
level is not created.
This attribute is used to specify the language of the enclosed content.
This property can be useful in several ways - it can be used to
ensure proper display of language-specific character usage (such as
quotes or decimal points), for speech synthesis, search engine content
classification or clarification of ambiguous character usage.
This attribute takes as its value a string that identifies a language
system used for communication (with the exception of computer languages.)
The syntax and registry of HTML language tags is identical to the system
specified in RFC 1766.
A language tag is composed of one or more parts: A primary language tag
and a possibly empty series of subtags:
language-tag = [Primary
Language Tag] ("-" [Language Subtag])*
[Primary Language Tag] = "i"
(for IANA defined languages) | "x" (custom/private use language) | [ISO 639 2-letter
[Language Subtag] =
[ISO 3166 2-letter country code] | [dialect or other locale/situation specific
Language tags are case-insensitive and spaces are not allowed. The
registering of language tags is administered by the
Internet Assigned Numbers Authority (IANA).
Example language tags include:
en en-US x-pig-latin
The LANG attribute overrides any language value specified by any
parent elements of the current element. If no value is specified at
any of these levels, the language inheritance mechanism goes up to
the HTTP protocol header 'Content-Language.' If this is also not
specified, a default may be determined from the user's browser settings
or some other criteria.
Valid RFC-1766 values representing a hierarchy of language tokens.
This attribute is used to specify the current scripting language in use for an
'Vbscript' both refer to Vbscript engines. 'XML' refers to an embedded XML
NOTE: Support grid information for the LANGUAGE attribute is
taken from MS' documentation.
If DIR=RTL is used on non-bidi content with inline elements, you
should probably only observe the punctuation characters swapping
ends of the sentence...it doesn't do a lot.
I have to admit a significant lack of knowledge with Right-to-left rendering
issues. I have done the best I can in this area in trying to document what I
can discover, but it is like the blind men describing the elephant by
feeling only parts of it. Take from that analogy what you will. =)
I do not know how to adequately test the LANG attribute either (with
confidence.) The standards part of the grid was easy, as was "trusting"
Microsoft's documentation. Opera's documents state that they do NOT
support it, and I am not sure if Netscape 6.x supports this yet.
Netscape 6.x renders all DIR="RTL" block content as right-aligned (even
elements like CENTER.)
DIR=RTL does nothing on the CAPTION element. Since it has an effect
on all other table elements, this just seems like an omission.
DIR=RTL on the RUBY element crashed my IE6 EVERY time. It
looks to be dangerous to use this combination. It worked in IE5-5.5.
DIR=RTL on the LABEL element did bad things in N6.1. Things got better in N6.2.
DIR=RTL on INPUT TYPE=file is a bad thing in Netscape 6.x. It doesn't like it.
Text entry in INPUT TYPE=password/text, and TEXTAREA elements is different
than normal when DIR=RTL is used: new characters typed are entered to the
left of the cursor/insertion pointer, not to the right as is typical with
western input modes.
The support listing for HTML 4.x says that DIR is supported on most of
the non-visually rendered elements. I don't really understand how this would
work, so I have ignored testing that in the browsers. IE's documentation
states it supports some of these, so they are listed as such on faith. =)