Login Register
Code2night
  • Home
  • Guest Posts
  • Blog Archive
  • Tutorial
  • Languages
    • Angular
    • C
    • c#
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • Security
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
    • SEO Analyzer
  1. Home
  2. Blogpost

lists in HTML

Date- Dec 09,2023

3012

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.









S
Shubham Saini
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

Responsive Slick Slider
Jul 28, 2022
How to add a WhatsApp share button on a website
Aug 22, 2022
Slick Slider with single slide
May 09, 2021
Code syntax higlighter using Prism js
Dec 12, 2020

Comments

Contents

More in HTML/CSS

  • Music Player 9306 views
  • How to create a table with fixed header and scrollable body 6379 views
  • Free PHP, HTML, CSS, JavaScript/TypeScript editor - CodeLobs… 4878 views
  • Child internet safety 4309 views
  • Registration Form In HTML 3976 views
View all HTML/CSS posts →

Tags

AspNet C# programming AspNet MVC c programming AspNet Core C software development tutorial MVC memory management Paypal coding coding best practices data structures programming tutorial tutorials object oriented programming Slick Slider StripeNet
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 | 1760
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
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blog Archive
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
  • SEO Analyzer
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
  • SEO Analyzer
By Language
  • Angular
  • C
  • c#
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • Security
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page