DEV 5.4 - Use lang, abbr & acronym to embed useful information
Some browsers/devices can utilise embedded information to more effectively communicate information about a page's contents.
- Identify all changes in the natural language within a page:
- Attach the
lang
attribute to almost any block level tag, or<span>;
- Choose the language argument from the list of ISO language codes.
- Attach the
- Use
<acronym>
and<abbr>
to expand acronyms and abbreviations using thetitle
attribute:- Some browsers style these using dotted underlines.
Acronym v abbr? There is much debate and confusion about what exactly constitutes an acronym versus an abbreviation. Also there is different support across browsers and changing support in new standards (acronym is likely to be dropped). The best advice is to adopt one and use it consistently and to always expand the abbreviation somewhere in the main bodyof the text.
Language change examples:
<html lang="en"> ...
<p>How do you say hello in French?</p>
<p>You say
<span lang="fr">Bonjour</span></p>
<p>And in German?</p>
<p lang="de">Guten tag </p>
<p lang="ga">
<a href="irishversion.html">
as gaeilge </a></p>
Acronym examples:
...<acronym title="World Wide Web">WWW</acronym>...
... the <acronym title="National Disability Authority">NDA</acrony