logo CBCE Skill INDIA

Welcome to CBCE Skill INDIA. An ISO 9001:2015 Certified Autonomous Body | Best Quality Computer and Skills Training Provider Organization. Established Under Indian Trust Act 1882, Govt. of India. Identity No. - IV-190200628, and registered under NITI Aayog Govt. of India. Identity No. - WB/2023/0344555. Also registered under Ministry of Micro, Small & Medium Enterprises - MSME (Govt. of India). Registration Number - UDYAM-WB-06-0031863

Discuss the list of HTML


Lists are used to organize and present information in a structured manner. There are three types of lists in HTML:

 

Ordered Lists (<ol>): Ordered lists are used when the order of items is important. Each list item is preceded by a number or another marker to indicate the sequence. The <ol> element is used to define an ordered list, and each list item is represented by the <li> (list item) element. Here's an example:

<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ol>

 

The above code will render as:

  1. First item
  2. Second item
  3. Third item

Unordered Lists (<ul>): Unordered lists are used when the order of items doesn't matter. Each list item is typically displayed with a bullet point. The <ul> element is used to define an unordered list, and each list item is represented by the <li> element. Here's an example:

<ul>
  <li>Red</li>
  <li>Green</li>
  <li>Blue</li>
</ul>

The above code will render as:

  • Red
  • Green
  • Blue

Definition Lists (<dl>): Definition lists are used to define terms and their corresponding descriptions. The <dl> element is used to define a definition list, the <dt> element represents the term, and the <dd> element represents the definition. Here's an example:

<dl>
  <dt>HTML</dt>
  <dd>Hypertext Markup Language</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
</dl>

 

The above code will render as:

HTML

  • Hypertext Markup Language

CSS

  • Cascading Style Sheets
  • You can also nest lists within lists to create hierarchical structures by placing one list inside another, such as an ordered list inside an unordered list or vice versa.
  • These list elements provide a way to structure and organize content, making it more readable and user-friendly on web pages.

Thank You.

Popular Post:

Give us your feedback!

Your email address will not be published. Required fields are marked *
0 Comments Write Comment