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

HTML Lists

Uploaded by

Jamshaid Ansari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

HTML Lists

Uploaded by

Jamshaid Ansari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

HTML Lists

HTML provides three types of lists to organize and


present information:
1. Ordered Lists (<ol>): Displays items in a specific
sequence, usually numbered.
2. Unordered Lists (<ul>): Displays items with
bullet points, not ordered.
3. Definition Lists (<dl>): Used for terms and their
definitions.

1. Ordered Lists (<ol>)


Ordered lists are numbered by default. They can also
be styled using the type attribute.
Syntax Example:

<ol>
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
</ol>
Output:
1. First Item
2. Second Item
3. Third Item
Styling Ordered Lists
The type attribute changes the style of numbering:
 type="1": Numbers (default)
 type="A": Uppercase letters
 type="a": Lowercase letters
 type="I": Uppercase Roman numerals
 type="i": Lowercase Roman numerals
Examples:
<ol type="A">
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
</ol>
<ol type="i">
<li>Chapter 1</li>
<li>Chapter 2</li>
<li>Chapter 3</li>
</ol>
Output:
 Type A: A. Apple
B. Banana
C. Cherry
 Type i: i. Chapter 1
ii. Chapter 2
iii. Chapter 3
2. Definition Lists (<dl>)
Definition lists are used for terms and their
descriptions.
Structure:
 <dl>: Definition list container.
 <dt>: Term (definition term).
 <dd>: Description (definition description).
Example:
<dl>
<dt>HTML</dt>
<dd>A markup language used to structure
webpages.</dd>
<dt>CSS</dt>
<dd>A stylesheet language used for styling
webpages.</dd>

Output:
 HTML: A markup language used to structure
webpages.
 CSS: A stylesheet language used for styling
webpages.

3.Unordered Lists (<ul>) in HTML


An unordered list is used to group a set of related
items in no particular order. Items in an unordered
list are typically displayed with bullet points (or other
symbols).

Basic Syntax of an Unordered List:


<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Output:
 Item 1
 Item 2
 Item 3
Each <li> tag represents a list item in the unordered
list.

You might also like