-
Hajipur, Bihar, 844101
A list in HTML is a collection of related items grouped together. HTML provides three main types of lists:
Ordered List (<ol>
) – numbered list
Unordered List (<ul>
) – bulleted list
Description List (<dl>
) – terms and definitions
<ol>
)Displays items in a numbered format.
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>
You can change the numbering style using the type
attribute:
type="1"
(default) → 1, 2, 3
type="A"
→ A, B, C
type="a"
→ a, b, c
type="I"
→ I, II, III
type="i"
→ i, ii, iii
<ul>
)Displays items with bullets.
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Orange</li>
</ul>
You can change the bullet style using the type
attribute (deprecated) or CSS:
disc
(default)
circle
square
<dl>
)Used for terms and definitions.
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
Lists can be nested within each other:
<ul>
<li>Fruits
<ul>
<li>Apple</li>
<li>Mango</li>
</ul>
</li>
<li>Vegetables</li>
</ul>
<ul style="list-style-type: square;">
<li>Item 1</li>
<li>Item 2</li>
</ul>
Q1. Create a numbered list of five programming languages.
Q2. Create a bulleted list of five grocery items.
Q3. Change the bullet style to circle
.
Q4. Display a list of fruits using an unordered list.
Q5. Create an ordered list with uppercase alphabet style.
Q6. Make a nested list of categories and subcategories.
Q7. Create a description list of HTML and CSS.
Q8. Use CSS to make bullets square-shaped.
Q9. Create a list of countries using <ol type="I">
.
Q10. Display an FAQ using a description list.
Q1: Which tag is used for ordered lists in HTML?
Q2: What tag defines a list item?
Q3: Which list is best for defining terms and definitions?
Q4: What does <ul> stand for?
Q5: Which tag is used inside a <dl> to define the term?
Q6: Which of the following is a valid type for <ol>?
Q7: What does the <dd> tag define?
Q8: Which attribute or style can change list bullets in CSS?
Q9: What tag is NOT used in description lists?
Q10: What is the default bullet style of <ul>?