Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When we should use <dl> over <ul>?

Tags:

In what scenarios we should go for <dl> not <ul>?

Does it matter for screen reader user <ul> or <dl>? does screen reader software notify user about content is in <ul> or <dl>?

like image 318
Jitendra Vyas Avatar asked Mar 10 '10 03:03

Jitendra Vyas


2 Answers

A <dl> is a definition list. It should be used in such a case as, perhaps, a dictionary:

Use-case:

<dl> <dt>Thesaurus</dt> <dd>A book for finding synonyms of other words, often alphabetical. Similar to a dictionary.</dd> </dl> 

Result of the above:

Thesaurus
A book for finding synonyms of other words, often alphabetical. Similar to a dictionary.


The idea being that the term-to-be-defined is held in the <dt> element, and the definition of that term is given in the <dd>.

A <ul> is an unordered list. Now, a <dl> does not imply any order to its contents, but it does imply a semantic relation between its children. A <ul>, however, could contain anything that is not ordered.

like image 113
David Thomas Avatar answered Oct 04 '22 18:10

David Thomas


When you're working with a set of definitions and not merely an list of unordered items.

like image 33
Sampson Avatar answered Oct 04 '22 16:10

Sampson