lists in HTML | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

lists in HTML

Date- Dec 09,2023

1389

1. Ordered Lists (<ol>):

  • i) Ordered lists are used to create lists with items that have a specific order or sequence, typically represented by numbers or letters.
  • ii) Each list item is wrapped in <li> (list item) tags.
  • iii) You can specify the type of numbering or bullet style using the type attribute of the <ol> element.


Example:-

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


In this example, an ordered list is created with three list items, and each item is numbered.


Result:-

2. Unordered Lists (<ul>):

  • i) Unordered lists are used to create lists with items that do not have a specific order and are typically represented by bullet points or other symbols.
  • ii) Each list item is wrapped in <li> (list item) tags.
  • Example:-
  • <ul> <li>Apples</li> <li>Bananas</li> <li>Oranges</li> </ul>

  • In this example, an unordered list is created with three list items, and each item is represented by a bullet point.

    Result:-


    3. Definition Lists (<dl>):

    • i) Definition lists are used to create lists of terms and their corresponding definitions.
    • ii) Each term is wrapped in a <dt> (definition term) tag, and each definition is wrapped in a <dd> (definition description) tag.

Example:-

<dl>

    <dt>HTML</dt>

    <dd>Hypertext Markup Language</dd>

    <dt>CSS</dt>

    <dd>Cascading Style Sheets</dd>

</dl>


In this example, a definition list is created with two terms and their corresponding definitions.

Result:-


You can also nest lists inside one another, combining ordered and unordered lists to create complex structures. For example, you can create a nested list with ordered and unordered lists as shown here:

<ol> <li>First item</li> <li>Second item <ul> <li>Sub-item 1</li> <li>Sub-item 2</li> </ul> </li> <li>Third item</li> </ol>

Result:-


In this case, the second list item contains a nested unordered list. This allows you to create hierarchical structures in your content.

Lists in HTML are essential for structuring information, creating navigation menus, and organizing content in a readable and accessible manner on web pages.









Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1190
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2025 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts