0% found this document useful (0 votes)
2 views

HTML basic tags

The document explains HTML lists, which are used to display related information in ordered or unordered formats. It details three types of HTML lists: ordered lists (<ol>), unordered lists (<ul>), and description lists (<dl>), along with examples of each. Additionally, it introduces nested lists, which are lists within other lists, providing a code example for better understanding.

Uploaded by

amitakhare092
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTML basic tags

The document explains HTML lists, which are used to display related information in ordered or unordered formats. It details three types of HTML lists: ordered lists (<ol>), unordered lists (<ul>), and description lists (<dl>), along with examples of each. Additionally, it introduces nested lists, which are lists within other lists, providing a code example for better understanding.

Uploaded by

amitakhare092
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

HTML Lists

A list is a record of short pieces of related information or used to display the data
or any information on web pages in the ordered or unordered form. For instance,
to purchase the items, we need to prepare a list that can either be ordered or
unordered list which helps us to organize the data & easy to find the item. Please
refer to the HTML <li> type Attribute article for the various types of attributes
that can be used with the ordered & unordered list.

HTML Lists are used to specify lists of information. All lists may contain one or
more list elements. There are three different types of HTML lists:

1. Ordered List or Numbered List (ol)


2. Unordered List or Bulleted List (ul)
3. Description List or Definition List (dl)
4. Nested List

HTML Ordered List or Numbered List

In the ordered HTML lists, all the list items are marked with numbers by default. It
is known as numbered list also. The ordered list starts with <ol> tag and the list
items start with <li> tag.

1. <ol>
2. <li>Aries</li>
3. <li>Bingo</li>
4. <li>Leo</li>
5. <li>Oracle</li>
6. </ol>

Output:

1. Aries
2. Bingo
3. Leo
4. Oracle
HTML Unordered List or Bulleted List

In HTML Unordered list, all the list items are marked with bullets. It is also known
as bulleted list also. The Unordered list starts with <ul> tag and list items start with
the <li> tag.

1. <ul>
2. <li>Aries</li>
3. <li>Bingo</li>
4. <li>Leo</li>
5. <li>Oracle</li>
6. </ul>

Output:
 Aries
 Bingo
 Leo
 Oracle

HTML Description List or Definition List

HTML Description list is also a list style which is supported by HTML and
XHTML. It is also known as definition list where entries are listed like a dictionary
or encyclopedia.

The definition list is very appropriate when you want to present glossary, list of
terms or other name-value list.

The HTML definition list contains following three tags:

1. <dl> tag defines the start of the list.


2. <dt> tag defines a term.
3. <dd> tag defines the term definition (description).
4. <dl>
5. <dt>Aries</dt>
6. <dd>-One of the 12 horoscope sign.</dd>
7. <dt>Bingo</dt>
8. <dd>-One of my evening snacks</dd>
9. <dt>Leo</dt>
10. <dd>-It is also an one of the 12 horoscope sign.</dd>
11. <dt>Oracle</dt>
12. <dd>-It is a multinational technology corporation.</dd>
13.</dl>

Output:

Aries
-One of the 12 horoscope sign.
Bingo
-One of my evening snacks
Leo
-It is also an one of the 12 horoscope sign.
Oracle
-It is a multinational technology corporation.
HTML Nested List

A list within another list is termed as nested list. If you want a bullet list inside a
numbered list then such type of list will called as nested list.

Code:

1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>Nested list</title>
5. </head>
6. <body>
7. <p>List of Indian States with thier capital</p>
8. <ol>
9. <li>Delhi
10. <ul>
11. <li>NewDelhi</li>
12. </ul>
13. </li>
14. <li>Haryana
15. <ul>
16. <li>Chandigarh</li>
17. </ul>
18. </li>
19. <li>Gujarat
20. <ul>
21. <li>Gandhinagar</li>
22. </ul>
23. </li>
24. <li>Rajasthan
25. <ul>
26. <li>Jaipur</li>
27. </ul>
28. </li>
29. <li>Maharashtra
30. <ul>
31. <li>Mumbai</li>
32. </ul>
33. </li>
34. <li>Uttarpradesh
35. <ul>
36. <li>Lucknow</li></ul>
37. </li>
38.</ol>
39.</body>
40.</html>

You might also like