HTML <dl> tagS2C Home   « HTML <dl> tag

Definition

The <dl> tag is used to define a defintion list.

The <dl> tag is used in conjunction with the <dt> (defintion term) and <dd> (defintion description) tags to create one or more groups of definitions.

Example


<dl>
  <dt>Boys Names</dt>
    <dd>Pugh</dd>
    <dd>Hugh</dd>
  <dt>Girls Names</dt>
    <dd>Charlotte</dd>
    <dd>Emily</dd>
    <dd>Jane</dd>
</dl>
Boys Names
Pugh
Hugh
Girls Names
Charlotte
Emily
Jane

Attributes

The following attributes can be used with the <dl> tag.


<dl> Specific Attributes
Attribute Value Description Example
There are no required or optional attributes specific to the <dl> tag.
<dl> Global Attributes
Attribute Description Example
Common
classSpecifies a classname for the element allowing you to apply the style of the predefined class to the content.

<dl class="name">Definition List</dl>
idSpecifies a unique id for the element allowing you to apply the style of the predefined id to the content.

<dl id="name">Definition List</dl>
styleSpecifies an inline style for the element allowing you to apply the style to the contentt.

<dl style="color:red;">Definition List</dl>
titleSpecifies an inline style for the element allowing you to apply the style to the content.

<dl title="Content info">Definition List</dl>
Keyboard
accesskeySpecifies a keyboard shortcut to associate with the element.

<dl accesskey="a">Definition List</dl>
tabindexSpecifies a tab order for the element.

<dl tabindex="1">Definition List</dl>
Language
dirSpecifies the directional flow of the content.

<!-- The text will flow from left to right -->
<dl dir="ltr">Definition List</dl>
<!-- The text will flow from right to left -->
<dl dir="rtl">Definition List</dl>
langSpecifies a language code for the content of the element.

<dl lang="en">Definition List</dl>
spellcheckSpecifies an inline style for the element allowing you to apply the style to the contentt.

<!-- Valid values true and false. -->
<!-- Default inherited / browser specific. -->
<dl spellcheck="true">Definition List</dl> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

<!-- Valid values yes and no. -->
<!-- Default yes. -->
<dl translate="no">Definition List</dl> 
Miscellaneous
contenteditableSpecifies whether the content of the element is editable.

<!-- Valid values true and false. -->
<!-- Default inherited. -->
<dl contenteditable="true">Definition List</dl> 
draggableSpecifies whether the element is draggable.

<!-- Valid values true and false. -->
<!-- Default browser specific. -->
<dl draggable="true">Definition List</dl>
hiddenSpecifies whether the element is not yet, or no longer, relevant.

<!-- Valid values an empty string or hidden -->
<dl hidden>Definition List</dl> 
<dl hidden="hidden">Definition List</dl> 
<dl> Event Attributes
Attribute Description Example
Document Element
oncopyThe script to be run when the user copies the content of an element.

 <!-- Executes go() function -->
<dl oncopy="go()">Definition List</dl> 
oncutThe script to be run when the user cuts the content of an element.

 <!-- Executes go() function -->
<dl oncut="go()">Definition List</dl>
onpasteThe script to be run when the user pastes some content into an element.

 <!-- Executes go() function -->
<dl onpaste="go()">Definition List</dl>
Drag and Drop
ondragThe script to be run when an element is dragged.

 <!-- Executes go() function -->
<dl ondrag="go()">Definition List</dl>
ondragendThe script to be run when an element has stopped being dragged.

 <!-- Executes go() function -->
<dl ondragend="go()">Definition List</dl>
ondragenterThe script to be run when an element has been dragged to a valid drop target.

 <!-- Executes go() function -->
<dl ondragenter="go()">Definition List</dl>
ondragleaveThe script to be run when an element leaves a valid drop target.

 <!-- Executes go() function -->
<dl ondragleave="go()">Definition List</dl>
ondragoverThe script to be run when an element is being dragged over a valid drop target.

 <!-- Executes go() function -->
<dl ondragover="go()">Definition List</dl>
ondragstartThe script to be run at the start of a drag operation.

 <!-- Executes go() function -->
<dl ondragstart="go()">Definition List</dl>
ondropThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<dl ondrop="go()">Definition List</dl>
Form
onblurThe script to be run when the element loses focus.

 <!-- Executes go() function -->
<dl onblur="go()">Definition List</dl>
onchangeThe script to be run when object changed and attempt to leave field.

 <!-- Executes go() function -->
<dl onchange="go()">Definition List</dl>
oncontextmenuThe script to be run when a context menu is triggered.

 <!-- Executes go() function -->
<dl oncontextmenu="go()">Definition List</dl>
onfocusThe script to be run when the element gets focus.

 <!-- Executes go() function -->
<dl onfocus="go()">Definition List</dl>
oninputThe script to be run when an element gets user input.

 <!-- Executes go() function -->
<dl oninput="go()">Definition List</dl>
oninvalidThe script to be run when an element is invalid.

 <!-- Executes go() function -->
<dl oninvalid="go()">Definition List</dl>
onresetThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<dl onreset="go()">Definition List</dl>
onselectThe script to be run when some or all of the contents of an object are selected.

 <!-- Executes go() function -->
<dl onselect="go()">Definition List</dl>
onsubmitThe script to be run when a form is submitted.

 <!-- Executes go() function -->
<dl onsubmit="go()">Definition List</dl>
Keyboard
onkeydownThe script to be run when an element is in focus and keyboard key is pressed down.

 <!-- Executes go() function -->
<dl onkeydown="go()">Definition List</dl>
onkeypressThe script to be run when an element is in focus and keyboard key is pressed down and released.

 <!-- Executes go() function -->
<dl onkeypress="go()">Definition List</dl>
onkeyupThe script to be run when an element is in focus and keyboard key is released.

 <!-- Executes go() function -->
<dl onkeyup="go()">Definition List</dl>
Media
onabortThe script code to be run on abort.

 <!-- Executes go() function -->
<dl onabort="go()">Definition List</dl>
oncanplayThe script to be run when a file has buffered enough so it is ready to start playing.

 <!-- Executes go() function -->
<dl oncanplay="go()">Definition List</dl>
oncanplaythroughThe script to be run when a file can be played all the way to the end without further need of buffering.

 <!-- Executes go() function -->
<dl oncanplaythrough="go()">Definition List</dl>
oncuechangeThe script to be run when the cue changes when using the track element.

 <!-- Executes go() function -->
<dl oncuechange="go()">Definition List</dl>
ondurationchangeThe script to be run when the length of the media is changed.

 <!-- Executes go() function -->
<dl ondurationchange="go()">Definition List</dl>
onemptiedThe script to be run when a media resource element suddenly becomes empty, usually due to an error.

 <!-- Executes go() function -->
<dl onemptied="go()">Definition List</dl>
onendedThe script to be run when the media has reach the end.

 <!-- Executes go() function -->
<dl onended="go()">Definition List</dl>
onloadeddataThe script to be run when media data is loaded and playback can start.

 <!-- Executes go() function -->
<dl onloadeddata="go()">Definition List</dl>
onloadedmetadataThe script to be run when metadata has been loaded.

 <!-- Executes go() function -->
<dl onloadedmetadata="go()">Definition List</dl>
onloadstartThe script to be run whenthe media resource has started loading.

 <!-- Executes go() function -->
<dl onloadstart="go()">Definition List</dl>
onpauseThe script to be run when the media resource has been paused.

 <!-- Executes go() function -->
<dl onpause="go()">Definition List</dl>
onplayThe script to be run when the media resource starts playback.

 <!-- Executes go() function -->
<dl onplay="go()">Definition List</dl>
onplayingThe script to be run when when playback has already begun.

 <!-- Executes go() function -->
<dl onplaying="go()">Definition List</dl>
onprogressThe script to be run when the browser is fetching the media data.

 <!-- Executes go() function -->
<dl onprogress="go()">Definition List</dl>
onratechangeThe script to be run when the playback rate changes.

 <!-- Executes go() function -->
<dl onratechange="go()">Definition List</dl>
onseekedThe script to be run when the seeking attribute is set to false indicating that seeking has finished.

 <!-- Executes go() function -->
<dl onseeked="go()">Definition List</dl>
onseekingThe script to be run when the seeking attribute is set to true indicating that seeking is currently active.

 <!-- Executes go() function -->
<dl onseeking="go()">Definition List</dl>
onstalledThe script to be run when the browser is unable to continue fetching media data.

 <!-- Executes go() function -->
<dl onstalled="go()">Definition List</dl>
onsuspendThe script to be run when media data has stopped before being completely loaded.

 <!-- Executes go() function -->
<dl onsuspend="go()">Definition List</dl>
ontimeupdateThe script to be run when the media resources current playback position has changed.

 <!-- Executes go() function -->
<dl ontimeupdate="go()">Definition List</dl>
onvolumechangeThe script to be run when the volume has changed or been muted.

 <!-- Executes go() function -->
<dl onvolumechange="go()">Definition List</dl>
onwaitingThe script to be run when the media resource has paused but is expected to resume.

 <!-- Executes go() function -->
<dl onwaiting="go()">Definition List</dl>
Mouse
onclickThe script to be run when when a mouse is clicked on an element.

 <!-- Executes go() function -->
<dl onclick="go()">Definition List</dl>
ondblclickThe script to be run when a mouse is double clicked on an element.

 <!-- Executes go() function -->
<dl ondblclick="go()">Definition List</dl>
onmousedownThe script to be run when he mouse button is pressed down while the cursor is over an element.

 <!-- Executes go() function -->
<dl onmousedown="go()">Definition List</dl>
onmousemoveThe script to be run when the mouse button is moved.

 <!-- Executes go() function -->
<dl onmousemove="go()">Definition List</dl>
onmouseoutThe script to be run when the mouse cursor moves off an element.

 <!-- Executes go() function -->
<dl onmouseout="go()">Definition List</dl>
onmouseoverThe script to be run when the mouse cursor moves over an element.

 <!-- Executes go() function -->
<dl onmouseover="go()">Definition List</dl>
onmouseupThe script to be run when the mouse button is released while the cursor is over the element.

 <!-- Executes go() function -->
<dl onmouseup="go()">Definition List</dl>
onwheelThe script to be run when the mouse wheel rolls up or down over an element.

 <!-- Executes go() function -->
<dl onwheel="go()">Definition List</dl>
Scroll
onscrollThe script code to be run when the scrollbar of an element is being scrolled.

 <!-- Executes go() function -->
<dl onscroll="go()">Definition List</dl> 
Window - NONE

Relevant HTML Tutorials

HTML Intermediate - Definition Lists