BBM Tutor
BBM Tutor

HTML5 Tag - <dfn>

Definition & Uses of HTML5 <dfn>

The HTML5 <dfn> tag is existed in HTML4.01, it has no difference and same in HTML5.

Syntax of HTML5 <dfn> Tag

<p><dfn>Term being defined</dfn> definition of the term </p>

What is HTML5 <dfn> ?

  • The HTML5 <dfn>( definition ) element represents the defining instance of a term.
  • The <dfn> element is one of the phrase elements in HTML5.
  • The <dfn> element must not contain any nested dfn elements.
  • The <dfn> element encloses the term being defined; the definition of the term should be given by the surrounding <p>, <section> or definition list group usually a <dt>, <dd> pair. Simply say dfn element contains a term which is described by the paragraph/section/definition list where it is placed.
  • If the <dfn> element has a title attribute, then the exact value of that attribute is the term being defined.
  • A <dfn> element must have both a start tag and an end tag.

Where to use HTML5 <dfn> Tag?

  • The <dfn> tag is used to provide importance (highlight) to the "definitions" in a content.
  • If the <dfn> element is specified, nearest parent of the dfn element(paragraph, description list group, or section) must also contain the definitions for the defining term.
  • The exact value of the term being defined is determined by the following rules:
  • If the <dfn> element has a title attribute, then the term is the value of that attribute.
  • Else, if it contains only an <abbr> element with a title attribute, then the term is the value of that attribute.
  • Otherwise, the text content of the <dfn> element is the term being defined.
  • The title attribute is often used to describe the definition.

Tips & Notes

  • Chrome and Safari browsers will display the content of <dfn> element in Upright Font.
  • Firefox and Opera browsers will display the text enclosed by <dfn> in Italic Font.

Simple HTML5 Example

<!DOCTYPE HTML>
<html>
<head>
<title> HTML5 <dfn> - HTML5 Tags Tutor </title>
</head>
<body>
<article>
<p><dfn>HTML5</dfn> is a markup language used for structuring and presenting content for the World Wide Weband a core technology of the Internet. </p>
</article>
</body>
</html>

Output Screen

HTML5 is a markup language used for structuring and presenting content for the World Wide Weband a core technology of the Internet.

Attributes

  • Attributes are the features added to a tag to provide the browser with more information about how the tag should appear or behave.
  • There are 3 type attributes a tag can have. They are Global Attributes, Event Attributes and Element-Specific Attributes.
  • The <dfn> tag is also capable of supporting the Global Attributes and Event Attributes in HTML5.

Element-Specific Attributes

Attributes

Description

Although it has no element-specific attributes, the title attribute has special semantics for this element. If the <dfn> tag has a title attribute, then the exact value of that attribute is the term being defined.

Simple HTML5 Example #2

In this example, we defined a term world wide web using <dfn> tag inside a paragraph( <p> ) element

<!DOCTYPE HTML>
<html>
<head>
<title> HTML5 <dfn> - HTML5 Tags Tutor </title>
</head>
<body>
<article>
<p>The <dfn title="World Wide Web">world wide web</dfn> is a system of interlinked hypertext documents accessed on the Internet. </p>
</article>
</body>
</html>

Output Screen

The world wide web is a system of interlinked hypertext documents accessed on the Internet.

Simple HTML5 Example #3

In this example, we defined a term world wide web using <dfn> tag inside a paragraph( <p> ) element, and then HTML5 also defined using < dfn> tag inside a definition list.

<!DOCTYPE HTML>
<html>
<head>
<title> HTML5 <dfn> - HTML5 Tags Tutor </title>
</head>
<body>
<article>
<p>The <dfn title="World Wide Web" id="World-Wide-Web">world wide web</dfn> is a system of interlinked hypertext documents accessed on the Internet. </p>
<dl>
<dt><dfn><abbr title="Hypertext Markup Language">HTML5</abbr></dfn></dt>
<dd>HTML5 is a markup language used for structuring and presenting content for the <a href="#World-Wide-Web">World Wide Web</a> and a core technology of the Internet.</dd>
<dt>PHP</dt>
<dd>PHP is a script language and interpreter that is freely available and used primarily on Linux Web servers. PHP, originally derived from Personal Home Page Tools, now stands for PHP: Hypertext Preprocessor, which the PHP FAQ describes as a "recursive acronym."</dd>
</dl>
</article>
</body>
</html>

Output Screen

The world wide web is a system of interlinked hypertext documents accessed on the Internet.

HTML5
HTML5 is a markup language used for structuring and presenting content for the World Wide Web and a core technology of the Internet.
PHP
PHP is a script language and interpreter that is freely available and used primarily on Linux Web servers. PHP, originally derived from Personal Home Page Tools, now stands for PHP: Hypertext Preprocessor, which the PHP FAQ describes as a "recursive acronym."
BBM Invoice
 
Disclaimer: Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.