Select Page

The dl tag, the definition list, in HTML5


The <dl> tag is used in conjunction with two other tags. These are and <dt> which means data term  and <dd> which means data definition or description.


nanadwumor

May 23, 2023



  • The <dl> is a definition or description list tag
  • The <dl> tag is used in conjunction with two other tags. These are and <dt> which means data term  and <dd> which means data definition or description.


RECOMMENDED ARTICLES


Difference Between Absolute and Relative References in HTML
Difference Between Absolute and Relative References in HTML

A relative reference does not specify the complete path to a web page. It specifies only the name of the web page. An absolute reference or url contains all the information necessary to locate a resource or target A relative reference does not...

Block And Inline Level Tags in HTML
Block And Inline Level Tags in HTML

Block elements start on a new line and end with a carriage return. That's, immediately after ending on a horizontal space, next block element goes to nest line. A block level element is like a container. It can contain other elements. Examples of...

Selecting a browser for HTML5 development
Selecting a browser for HTML5 development

Google's Chrome browser is simple to use and has the most up-to-date HTML5 features making it easier for developers. It also has pretty good developer tools. We recommend you use this browser to learn HTML5 Chrome Firefox Opera Apple Safari...


The <dl> is a definition or description list tag. It displays items just as it is in dictionary. dl is short for definition list.

The <dl> tag is used in conjunction with two other tags. These are and <dt> which means data term  and <dd> which means data definition or description.

The <dt> delimits the data term or word to define. The <dd> delimits the description of the data.

Syntax

Output

html </p>
<dl> tag

Join Other Subscribers on Our YouTube Channel and Don’t Miss a thing!


For example,

Output

html </p>
<dl> tag example

The <dl> , although was designed to format dictionary style definitions, is very useful in a name and value pair list. 

The standard layout of the <dl> or definition list indents each definition description. 

However, you can change the layout of the default definition list to any different layout of your choice using CSS.

Example 1: This CSS code boldens and underlines the data term.

For example, We see HTML in bold face and underlined. The CSS also removes the default indentation of the data description (dd)) by setting margin and left-padding to 0.

Output

html </p>
<dl> tag example with css

Example 2:

Output

html </p>
<dl>tag example with css

Example 3: We can use the CSS Flexible Box Layout (Flexbox).

Output

html </p>
<dl> tag example with css

No bullets used by <dl> tag

Unlike the <ul> or <ol> tag, the <dl> tag doesn’t use bullets or numbers.

Common uses of the <dl> tag

The <dl> tag can be used for

  • a list marked by key terms,but not than bullets or numbers.
  • forms,

  • figures with captions, etc

Supporting Browsers

Browser Status
Chrome Yes
Internet Explorer Yes
Opera Yes
Safari Yes
Firefox Yes

You May Also Like…




0 Comments

Submit a Comment

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