Lists in HTML are an essential part of web design that help organize content in a structured and readable way. Whether you want to display items in a sequence or group related information together, HTML provides different types of lists such as ordered lists, unordered lists, and description lists.
List in HTML
In HTML, lists are used to organize content into structured items. HTML supports ordered, unordered, and definition lists.
Different list tags are
| List Tags | Definition |
|---|---|
| <OL> | Defines an ordered list |
| <UL> | Defines an unordered list |
| <LI> | Defines a list item |
| <DL> | Define a definition list. |
| <DT> | Defines a definition term |
| <DD> | Defines a definition description |
| <DIR> | Deprecated. Use instead |
| <MEN> | Deprecated, use instead |
Unordered Lists
An unordered list in HTML is a list where items are displayed with bullet points instead of numbers. It is created using the <ul> tag and each item inside the list is wrapped with <li> (list item).
Syntax:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Ordered list
An ordered list is created using the <ol> tag. The ordered list helps to create a number list; by default, the ordered list creates the sequence of number.
Syntax:
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Definition Lists
A definition list in HTML is used when you want to present terms and their meanings. A definition list is not a list of items.
- <dl>: definition list (container)
- <dt>: definition term (the word or phrase being defined)
- <dd>: definition description (the explanation or meaning)
Syntax,
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language, used to structure web pages.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets, used to style web pages.</dd>
<dt>JavaScript</dt>
<dd>A programming language that adds interactivity to websites.</dd>
</dl>
Disclaimer: We have provide you with the accurate handout of “List in HTML“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above study material present on our websites is for education purpose, not our copyrights.
Images and content shown above are the property of individual organisations and are used here for reference purposes only. To make it easy to understand, some of the content and images are generated by AI and cross-checked by the teachers.