HTML LISTS

HTML सूचियाँ (Lists) क्या है?

HTML Webpage में Important Text को Points में Show कराने के लिए Lists का उपयोग किया जाता हैं।

HTML Lists को Define करने के लिए List Elements का उपयोग किया जाता हैं।

HTML Lists Document Structure को बनाए रखती है और महत्वपूर्ण सूचना (Important Information) को Points में Display करने में मदद करती हैं। जिससे हमारा Content meaningful और readable होता हैं।

HTML Lists का उपयोग Articles के अलावा Websites में Navigation Menu Create करने के लिए भी किया जाता है और E-commerce Websites में Product Features को Display कराने के लिए HTML Lists का ही उपयोग किया जाता हैं।

इसलिए HTML List बहुत महत्वपूर्ण होती हैं।

उदाहरण:

An Unordered HTML or Bullet LISTS:

  • Item one
  • Item two
  • Item three
  • Item Four
  • Item Five

An Ordered HTML or Numbered LISTS:

  1. First Item
  2. Second Item
  3. Third Item
  4. Fourth Item
  5. Fifth Item



Names of HTML Elements Used to Create HTML List:

  1. ul Element
  2. ol Element
  3. li Element
  4. dl Element
  5. dt Element
  6. dd Element

HTML List बनाने के लिए Use होने वाले HTML Elements के नाम:

  1. ul Element
  2. ol Element
  3. li Element
  4. dl Element
  5. dt Element
  6. dd Element



HTML LISTS के प्रकार

HTML Webpage में Data को Points में दिखाने के लिए कई प्रकार की Lists का उपयोग किया जाता हैं। प्रत्येक प्रकार की List का अपना विशेष उद्देश्य और अर्थ होता हैं।

HTML List के प्रकार निम्नलिखित हैं:

  1. Unordered HTML List
  2. Ordered HTML List
  3. Definition HTML List
  4. Nested HTML List- Nested List वैसे कोई HTML प्रकार नही हैं। लेकिन हमने इसे यहाँ 4th प्रकार के रूप में शामिल किया गया हैं।



Unordered (अनियंत्रित) HTML List (सूची) क्या है?

Unordered List को <ul> Tag द्वारा Define किया जाता हैं। प्रत्येक List Item <li> Tag से शुरू होती हैं।

Unordered HTML List का उपयोग एक प्रकार की सूचना को बिना किसी तय क्रम में दिखाने के लिए किया जाता हैं।

Unordered List को Bulleted List भी कहते है, क्योंकि List Items के पहले Bullet (small black circles) लग जाते हैं।

उदाहरण:

<!DOCTYPE>
<html>
<head>
     <title>Unordered List</title>
</head>
<body>
     <h2>Unordered HTML List of Three Employees Name:</h2>
     <ul>
          <li>Raj Kumar</li>
          <li>Mahendra Shinde</li>
          <li>Dinesh Jain</li>
     </ul>
</body>
</html>

Output:

Unordered HTML List of Three Employees Name:

  • Raj Kumar
  • Mahendra Shinde
  • Dinesh Jain



Choice Difference Bullets के साथ Unordered List

CSS list-style-type की property का उपयोग list item की style को परिभाषित करने के लिए किया जाता हैं।

इसके निम्नलिखित मूल्य हो सकते हैं:

Values Descripton
disc Sets the list item marker to a bullet (default)
circle Sets the list item marker to a circle
square Sets the list item marker to a square
none The list items will not be marked

उदाहरण 1: disc

<h2>Unordered HTML List with Disc Bullets</h2>
<h2>Unordered HTML List with circle</h2>
<ul style="list-style-type: disc;">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ul>

उदाहरण 2: circle

<h2>Unordered HTML List with circle</h2>
<ul style="list-style-type: circle;">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ul>

उदाहरण 3: square

<h2>Unordered HTML List with square</h2>
<ul style="list-style-type: square;">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ul>

उदाहरण 4: none

<h2>Unordered HTML List without Bullets</h2>
<ul style="list-style-type: none;">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ul>



Ordered (नियंत्रित) HTML List (सूची) क्या है?

Ordered List को <ol> Tag द्वारा Define किया जाता हैं। प्रत्येक List Item <li> Tag से शुरू होती हैं।

Ordered HTML List का उपयोग एक प्रकार की सूचना को बिना किसी तय क्रम में दिखाने के लिए किया जाता हैं।

Ordered List को Numbered List भी कहते है, क्योंकि List Items के पहले Number लग जाते हैं।

उदाहरण:

<!DOCTYPE>
<html>
<head>
     <title>Ordered List</title>
</head>
<body>
     <h2>Ordered HTML List of Three Employees Name:</h2>
     <ol>
          <li>Raj Kumar</li>
          <li>Mahendra Shinde</li>
          <li>Dinesh Jain</li>
     </ol>
</body>
</html>

Output:

Ordered HTML List of Three Employees Name:

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain



Ordered HTML List - The Type Attribute

In Ordered List, type Attribute is used to define the List Style Type.
Ordered List में type Attribute का उपयोग List Style Type को Define करने के लिए किया जाता हैं।

By Default, "Number" is used for List Items in OL List. But, with the help of type Attribute, we can apply 4 other types of List Style Type in addition to Number.
By Default OL List में List Items के लिए “Number” का उपयोग किया जाता हैं। लेकिन, type Attribute की सहायता से हम Number के अलावा 4 अन्य प्रकार की List Style Type लगा सकते हैं।

The type attribute of the <ol> tag, defines the type of the list item.
<ol> tag का type attribute, list item के प्रकार को परिभाषित करता हैं।

इसके निम्नलिखित मूल्य हो सकते हैं:

Values Descripton
type="1" List items will be numbered with numbers (default).
सूची आइटम को संख्याओं के साथ क्रमांकित किया जाएगा (डिफ़ॉल्ट)
type="A" List items will be numbered with uppercase letters.
सूची आइटम अपरकेस अक्षरों के साथ गिने जाएंगे।
type="a" List items will be numbered with lowercase letters.
सूची आइटम को लोअरकेस अक्षरों के साथ क्रमांकित किया जाएगा।
type="I" List items will be numbered with uppercase roman numbers.
सूची आइटम को अपरकेस रोमन नंबरों के साथ क्रमांकित किया जाएगा।
type="i" List items will be numbered with lowercase roman numbers.
सूची आइटम को लोअरकेस रोमन नंबरों के साथ क्रमांकित किया जाएगा।

Exammple (उदाहरण) 1: Numbers

<h2>Ordered HTML List with Numbers</h2>
<ol type="1">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ol>

Output:

Ordered HTML List with Numbers

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain

Exammple (उदाहरण) 2: Uppercase Letters

<h2>Ordered HTML List with Uppercase Letters</h2>
<ol type="A">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ol>

Output:

Ordered HTML List with Uppercase Letters

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain

Exammple (उदाहरण) 3: Lowercase Latters

<h2>Ordered HTML List with Lowercase Latters</h2>
<ol type="a">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ol>

Output:

Ordered HTML List with Lowercase Latters

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain

Exammple (उदाहरण) 4: Uppercase Roman Letters

<h2>Unordered HTML List with Uppercase Roman Letters</h2>
<ol type="I">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ol>

Output:

Ordered HTML List with Uppercase Roman Letters

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain

Exammple (उदाहरण) 5: Lowercase Roman Letters

<h2>Unordered HTML List with Lowercase Roman Letters</h2>
<ol type="i">
    <li>Raj Kumar</li>
    <li>Mahendra Shinde</li>
    <li>Dinesh Jain</li>
</ol>

Output:

Ordered HTML List with Lowercase Roman Letters

  1. Raj Kumar
  2. Mahendra Shinde
  3. Dinesh Jain



Definition List (सूची) क्या है?

किसी शब्द या Term विशेष को परिभाषित करने के लिए Definition Lists को बनाया जाता हैं।

Definition List को <dl> Tag से Define किया जाता हैं।

Definition Term को <dt> और Definition Description को <dd> Element से Define किया जाता हैं।

उदाहरण:

<!DOCTYPE>
<html>
<head>
     <title>Definition or Description List</title>
</head>
<body>
     <h2>Definition or Description List:</h2>
     <dl>
          <dt>Raj Kumar</dt>
          <dd>It is a Software Engineer.</dt>
          <dt>Mahendra Shinde</dt>
          <dd>It is a Doctor.</dt>
          <dt>Dinesh Jain</dt>
          <dd>It is a Manager.</dt>
     </dl>
</body>
</html>

Output:

Definition or Description List:

Raj Kumar
It is a Software Engineer.
Mahendra Shinde
It is a Doctor.
Dinesh Jain
It is a Manager.