<abbr> Tag Syntax
Rules for coding HTML abbr
elements
<body> ... ... phrasing content expected ...<abbr title="meaning">... phrasing content ...</abbr>... ... </body>
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Code the abbr element for an acronym or abbreviation where phrasing content is expected.
- Begin the abbr element with a starting <abbr> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include a
title
attribute on the <abbr> tag with the expanded meaning of the acronym. - Include the acronym or abbreviation as the content within the tags.
- End the abbr element with a matching
</abbr>
closing tag. - If the abbreviation stands for a term that is being defined in the same paragraph, wrap a <dfn> tag around the
abbr
element. If the abbreviation itself is being defined, rather than what it stands for, include atitle
attribute on the <dfn> tag with the same abbreviation to override thetitle
attribute inherited from the <abbr> tag. See the examples of the <dfn> tag.
Content Model
Content of the abbr element
The content of the dt element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.
Optional
- The content within the tags may also be a hyperlink that links to the acronym definition and shows the user the meaning of the acronym using a pop-up tool tip:
<abbr> <a href="http://www.Acronyms.net/terms/t/Three-Letter-Acronym/" title="Three Letter Acronym">TLA</a> </abbr>