Aapko har list ka purpose samajhna zaroori hai, jisse aap apni website ya page ko acche se organize kar sakein. Chaliye in 3 types ki lists ko detail me samajhte hain.
Types of Lists In HTML :
1 – Ordered Lists (<ol>):
Ordered list wo hoti hai jisme items ki specific order hoti hai (numbers ya letters ke saath). Isme bhi har item ke liye <li> tag ka use hota hai, aur items ko number ya letter ke format me dikhaya jata hai. Agar aap A, B, C, … format me ordered list dikhana chahte hain, toh type=”A” use kar sakte hain. HTML me ordered lists ke 5 main types hote hain.
- Numerical List (1, 2, 3, …)
- Alphabetical Lowercase (a, b, c, …)
- Alphabetical Uppercase (A, B, C, …)
- Roman Lowercase (i, ii, iii, …)
- Roman Uppercase (I, II, III, …)
<ol type="A">
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
</ol>
Output :
- First Item
- Second Item
- Third Item
Yeh list ordered hogi, jisme items A, B, C order me dikhai denge.
2 – Unordered Lists (<ul>):
Unordered list wo hoti hai jisme items ki koi specific order nahi hoti. Isme har item ke liye <li> tag ka use hota hai. By default, unordered lists me items ke samne bullets (●) hoti hain. HTML me unordered lists ke 3 main types hote hain, jo list-style-type attribute ke through define kiye jate hain.
- Disc
- Circle
- Square
<ul style="list-style-type: square;">
<li>Apples</li>
<li>Bananas</li>
<li>Grapes</li>
</ul>
Output :
- Apples
- Bananas
- Grapes
Is example me fruits ki list dikhegi, har item ke aage square point hoga.
3 – Description Lists (<dl>, <dt>, <dd>):
HTML me Description List ka use tab hota hai jab hume terms aur unke descriptions ko dikhana ho. Ye list dictionary-style format me hoti hai, jisme term aur uska definition diya jata hai.
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language, jo web pages banane ke liye use hota hai.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets, jo web pages ko style aur design karne me madad karta hai.</dd>
</dl>
Output :
- HTML
- HyperText Markup Language, jo web pages banane ke liye use hota hai.
- CSS
- Cascading Style Sheets, jo web pages ko style aur design karne me madad karta hai.
Description List ke Tags:
- <dl> (Description List) – Puri description list ko wrap karta hai.
- <dt> (Description Term) – List ke andar term ya title define karta hai.
- <dd> (Description Definition) – Term ka detailed explanation ya definition provide karta hai.
Nested Lists:
Nested Lists ka matlab hota hai list ke andar ek aur list. HTML me kisi bhi Ordered List (<ol>) ya Unordered List (<ul>) ke andar ek aur list add ki ja sakti hai.
- Programming Languages
- Python
- Java
- JavaScript
- Web Technologies
- HTML
- CSS
- React.js
Quiz: Test Your Knowledge on HTML List Tags
Bonus: Practical Application!
Try Adding HTML List Tags to Your Webpage Today!
Choose tags like <ul>
, <ol>
, <li>
, and structure your content with ordered and unordered lists for better organization.