Open In App

How to define terms with HTML ?

Last Updated : 28 Dec, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will see how to define the terms with HTML. HTML facilitates us with some ways to define or describe the text so that users can get the exact meaning or message the developer wanted to deliver. A description list is a list of terms, with a description of each term. Lists in HTML are used for specifying particular information in list form. We will understand all the related terms with the relevant examples.

Definition element: In HTML, we can use the <dfn> tag to describe the word and for showing the first occurrence of the word. The text inside this tag is visible in the italic form on the browser which shows that it is a special kind of keyword or value.

Syntax:

<dfn title ="meaning"> Content </dfn>

 

Value:

  • title: This attribute define the meaning of the text that is visible when we hover on the text.

Example: This example describes the use of the Definition element. 

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>How to define terms in HTML</title>
</head>
  
<body>
    <h2>Welcome To GFG</h2>
    <h3>He is a
        <dfn title=
"Cricket is the game played with bat and ball">
          Cricketer.
        </dfn>
    </h3
</body>
  
</html>


Output:

HTML <dfn> tag

Abbreviation element: Abbreviation element is also used to describe the term we are using and it also uses a dotted line below the text to show the special appearance of the text. It is defined using <abbr> tag.

Syntax:

<dfn> Content </dfn>   
<abbr title="description"> Content </abbr>

Value:

  • title: This attribute (in this tag) is used to give a description of the text.

Example: This example describes the use of the Abbreviation element.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>How to define terms in HTML</title>
</head>
  
<body>
    <h2>Welcome To GFG</h2>
    <h3> The
        <dfn> Discovery of India </dfn>
        book was written by
        <abbr title=
"The first Prime Minister of India"
            Pt. Jawahar Lal Nehru.
        </abbr>
    </h3
</body>
  
</html>


Output:

HTML <abbr> Tag

Description list: The Description list is a list in which each item comes with its description. A description list is defined using <dl> tag followed by two more tags <dt> & <dd>.

Syntax:

<dl>
    <dt> term </dt>
    <dd> description </dd>
</dl>

Example: This example describes the use of the Description list.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Description list</title>
</head>
  
<body>
    <h2>Welcome To GFG</h2>
    <h3> List of items and their definitions</h3>
    <dl
    <dt>HTML</dt>
        <dd>
            HTML is a Markup language used 
            to structure our web pages.
        </dd
    <dt>CSS</dt>
        <dd>
            CSS stands for Cascading Style sheet.
            It is used to style our webpage.
        </dd
    <dt>JavaScript</dt>
        <dd>
            JavaScript is a scripting language 
            and it is used to provide functioning 
            to our web page.
        </dd>
    </dl>
</body>
  
</html>


Output:

HTML Description list



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads