DEV Community

Cover image for HTML tags | dfn
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tags | dfn

It is used to indicate the term to be defined in the context of a phrase or content. Its closest parent will be the one that will have to contain said definition (a <p>, a <dt>/<dd> pair, a <section>...).

It has a title attribute that, if present, must contain the term that is being defined and not other text.

Within the <dfn> we can find 4 cases:

  • Content only: <p><dfn>HTML</dfn> is the standard markup language for creating web pages.</p>
  • The content with the title attribute: <p><dfn title="HyperText Markup Language">HTML</dfn> is the standard markup language for creating web pages.</p>
  • The content within an <abbr>: <p><dfn><abbr title="HyperText Markup Language">HTML</abbr></dfn> is the standard markup language for creating web pages.</p>
  • The content with an id attribute and then referenced: <p><dfn id="html-def">HTML</dfn> is the standard markup language for creating web pages.</p>… …<p>Learn <a href="#html-def">HTML</a> now.</p>

Has an implicit ARIA role term.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Discussion (0)