Menu

Related Topics

HTML CSS JavaScript PHP Node.js React.js C C++ Go Rust Swift Python Java Excel MS Word PowerPoint
Search

HTML List क्या है?

HTML में Lists का इस्तेमाल एक जैसे या related items को व्यवस्थित तरीके से दिखाने के लिए किया जाता है। Lists की मदद से information को पढ़ना और समझना आसान हो जाता है। HTML में मुख्य रूप से तीन प्रकार की lists होती हैं — Ordered List, Unordered List और Description List।

इसके अलावा <li> tag का इस्तेमाल list के individual items के लिए किया जाता है और एक list के अंदर दूसरी list बनाकर Nested List भी बनाई जा सकती है।

Ordered List (<ol>)

Ordered List का इस्तेमाल उन items के लिए किया जाता है जिनका कोई sequence, order या numbering हो। इसमें browser सामान्यतः items के आगे numbers दिखाता है, जैसे 1, 2, 3 आदि।

Ordered List बनाने के लिए <ol> tag और उसके अंदर प्रत्येक item के लिए <li> tag का इस्तेमाल किया जाता है।

Ordered List का Basic Example
HTML

इस example में <ol> पूरी ordered list को define करता है, जबकि प्रत्येक <li> एक individual list item को represent करता है। Browser इन items को default रूप से 1, 2 और 3 की numbering के साथ दिखाएगा।

Ordered List में Sequence

Ordered List तब ज्यादा useful होती है जब items का order important हो। उदाहरण के लिए किसी process के steps, instructions, ranking या किसी procedure के अलग-अलग steps को ordered list में दिखाया जा सकता है।

जैसे:

  1. HTML सीखें
  2. CSS सीखें
  3. JavaScript सीखें

यहाँ items का sequence एक logical order को represent करता है।

Unordered List (<ul>)

Unordered List का इस्तेमाल उन items के लिए किया जाता है जिनका कोई specific sequence या numbering जरूरी नहीं है। इसमें browser सामान्यतः items के आगे bullet points दिखाता है।

Unordered List बनाने के लिए <ul> tag और प्रत्येक item के लिए <li> tag का इस्तेमाल किया जाता है।

Unordered List का Basic Example
HTML

इस example में browser items को bullet points के साथ display करेगा। यहाँ items का order important नहीं है, इसलिए <ul> का इस्तेमाल किया गया है।

Unordered List का इस्तेमाल कहाँ होता है?

Unordered Lists का इस्तेमाल website navigation items, features, product lists, ingredients, related topics और ऐसे कई content sections में किया जा सकता है जहाँ items को किसी particular order में दिखाना जरूरी नहीं होता।

Description List (<dl>)

Description List का इस्तेमाल किसी term के साथ उसकी definition, description या additional information दिखाने के लिए किया जाता है। यह dictionary या glossary जैसी information के लिए useful होती है।

Description List में मुख्य रूप से तीन tags इस्तेमाल होते हैं:

Description List का Example
HTML

ऊपर के example में <dl> पूरी description list है। <dt> में term और <dd> में उस term की description दी गई है।

List Item (<li>)

<li> का मतलब List Item होता है। इसका इस्तेमाल list के प्रत्येक individual item को define करने के लिए किया जाता है।

<li> को सामान्यतः <ol> या <ul> के अंदर इस्तेमाल किया जाता है। Description List में <dt> और <dd> का इस्तेमाल होता है, इसलिए वहाँ <li> की आवश्यकता नहीं होती।

उदाहरण:

HTML

इस example में तीन अलग-अलग <li> elements हैं। Browser इन सभी को <ul> के अंदर list items के रूप में display करता है।

Nesting of Lists

HTML में एक list के अंदर दूसरी list बनाना Nested List कहलाता है। इसका इस्तेमाल तब किया जाता है जब किसी main item के अंदर उससे related sub-items दिखाने हों।

उदाहरण के लिए, अगर किसी website पर Fruits एक main category है और उसके अंदर Mango तथा Banana जैसे items हैं, तो इन्हें nested list के रूप में दिखाया जा सकता है।

Nested List का Example
HTML

इस example में पहली <ul> main list है। इसके अंदर Fruits एक list item है और Fruits के अंदर दूसरी <ul> रखी गई है। यह दूसरी list nested list है।

Ordered List के अंदर Unordered List

Nested lists में केवल <ul> के अंदर <ul> ही जरूरी नहीं है। आप जरूरत के अनुसार ordered और unordered lists को एक-दूसरे के अंदर भी use कर सकते हैं।

HTML

यहाँ main list <ol> है, इसलिए Frontend और Backend numbered items हैं। इनके अंदर <ul> का इस्तेमाल करके sub-items बनाए गए हैं।

Styling HTML Lists with CSS

HTML lists को CSS की मदद से काफी आसानी से customize किया जा सकता है। आप list के bullets या numbers, text color, background, spacing, padding, border और अन्य properties को बदल सकते हैं।

नीचे एक example में ordered और unordered list को CSS के साथ style किया गया है। इसमें list items के बीच spacing, background, border और colors को customize किया गया है।

HTML
CSS में इस्तेमाल हुई मुख्य Properties

Complete HTML Lists Example

अब नीचे एक complete example दिया गया है जिसमें Ordered List, Unordered List, Description List और Nested List सभी को एक ही HTML page में इस्तेमाल किया गया है।

HTML

Important Points to Remember

Conclusion

HTML Lists webpage के content को व्यवस्थित और readable बनाने का एक आसान तरीका हैं। <ol> का इस्तेमाल तब किया जाता है जब items का sequence important हो, जबकि <ul> का इस्तेमाल सामान्य items के लिए किया जाता है। दूसरी तरफ <dl> terms और उनकी descriptions को represent करने के लिए useful है।

<li> की मदद से individual list items बनाए जाते हैं और nested lists की मदद से main items के अंदर sub-items भी दिखाए जा सकते हैं। CSS के साथ इन lists को अपने webpage के design के अनुसार आसानी से style किया जा सकता है।


Code copied!

Page Views
0
Visit ID
Not tracked yet
Visit Time
-
Time on Page
0 seconds

Request


Leave a Comment


INITIALIZING...


INITIALIZING...


Quizzes in Hindi

GK Online Quiz in Hindi 10 pages
HTML Online Quiz in Hindi 10 pages
CSS Online Quiz in Hindi 10 pages
JavaScript Online Quiz in Hindi 10 pages
CCC Online Quiz in Hindi 10 pages
History Online Quiz in Hindi 10 pages



Comments Total: 0 comments

📰 Latest Articles

Total: 0 Articles

Featured Products

0 Products 0 Loaded 0 Remaining

All Products Loaded!

You've reached the end of our collection.

Contact Us Form