HTML dd tag


Description:

The HTML dd tag contains a description in a definitions list (HTML dl element). These descriptions may be visually associated to a term (HTML dt element) or not.

In definition lists a single term can have many descriptions or none at all. On the other hand, a description may have no term associated. These decisions are left to the author's consideration.

The <dd> tag is used to describe a term/name in a description list.

The <dd> tag is used in conjunction with <dl> (defines a description list) and <dt> (defines terms/names).

Inside a <dd> tag you can put paragraphs, line breaks, images, links, lists, etc.

Difference between HTML and XHTML:

NONE

Differences Between HTML 4.01 and HTML5:

In HTML 4.01, the <dd> tag was used to describe an item in a definition list.

In HTML5, the <dd> tag is used to describe a term/name in a description list.

Example:

Code

<dl>

<dt>Definition List</dt>

<dd>A list of terms and their definitions/descriptions.</dd>

<dt>HTML</dt>

<dd>An HTML tutorial.</dd>

<dt>PHP</dt>

<dd>An PHP tutorial.</dd>

</dl>

 
View
Definition List
A list of terms and their definitions/descriptions.
HTML
An HTML tutorial.
PHP
An PHP tutorial.

 

In the next example, a chat conversation is represented by a list, where the names of the persons are shown with the HTML dt element and their lines by the HTML dd element.

Code View
<dl>
<dt>Charles</dt>
<dd>Hi</dd>
<dd>Are you there?</dd>
<dt>Susan</dt>
<dd>Hi!!</dd>
<dd>Yes, I'm here…</dd>
<dt>Charles</dt>
<dd>How are you!?</dd>
<dt>Susan</dt>
<dd>Fine, I was hoping to find you here… I need to tell you something</dd>
</dl>
Charles
Hi
Are you there?
Susan
Hi!!
Yes, I'm here…
Charles
How are you!?
Susan
Fine, I was hoping to find you here… I need to tell you something

Standard Attributes:

Attribute Description
class Document wide identifier
dir Specifies the direction of the text
id Document wide identifier
title Specifies a title to associate with the element.
style Helps to include inline casecadubf style sheet.
lang Sets the language code.

Event Attributes:

Attribute Description
onclick Script runs when a mouse click
ondblclick Script runs when a mouse double-click
onmousedown Script runs when mouse button is pressed
onmouseup Script runs when mouse button is released
onmouseover Script runs when mouse pointer moves over an element
onmousemove Script runs when mouse pointer moves
onmouseout Script runs when mouse pointer moves out of an element
onkeypress Script runs when key is pressed and released
onkeydown Script runs when key is pressed
onkeyup Script runs when key is released
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Designed for Mytoptutorials.com