Text in HTML: Definitions and Abbreviations

The elements used for creating definitions and abbreviations are <dfn> and <abbr> respectively. The <dfn> element is used to identify the term to be defined, while the definition of the term is placed outside the element. The content of the element (i.e., the term) is usually rendered in italic type by browsers. The <abbr> element is used to identify an abbreviation, while the description of the abbreviation is provided with the title attribute. This description is usually displayed as a pop-up by browsers when the cursor is on the abbreviation. In some browsers, such as Firefox, the abbreviation may also be underlined with a dashed or dotted line. The element should be used instead of the obsolete <acronym> element. Figure 3.20 shows how these elements are used, and Figure 3.21 shows the result.

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *