HTML Lists
Last Updated:
HTML Lists
HTML provides web developers three ways for specifying lists of information. All lists must contain one or more list elements.
The three types in HTML lists are
- <ul> - unordered list. Used to list items using plain bullets.
- <ol> - ordered list. Used to list items using numbers (starting from 1).
- <dl> - descriptions list. Displays list items in the same way as they are arranged in a dictionary.
HTML Ordered Lists
The <ol> tag defines an ordered list of items.
Note: The <li> tag defines a list item.
Example
<!DOCTYPE html>
<html>
<body>
<ol>
<li>Apple</li>
<li>Banana</li>
</ol>
</body>
</html>
HTML UnOrdered Lists
The <ul> tag defines an unordered list of items.
Note: The <li> tag defines a list item.
Example
<!DOCTYPE html>
<html>
<body>
<ul>
<li>Apple</li>
<li>Banana</li>
</ul>
</body>
</html>
HTML Description Lists
The Description Lists displays list items in the same way as they are arranged in a dictionary.
The 3 HTML description list tags are given below:
- <dl> - Specifies a description list.
- <dt> - Specifies a term in a description list.
- <dd> - Describes about the preceding term (<dt>) in the description list (<dl>).
Example
<!DOCTYPE html>
<html>
<body>
<dl>
<dt>Apple</dt>
<dd>Apple Prevents Cancer</dd>
<dt>Banana</dt>
<dd>Banana Cure Ulcers and Heart Burn</dd>
</dl>
</body>
</html>
Share this Page
Meet the Author