Skip to content
  • Quizes
  • QStack
  • Blog
  • pinterest
  • instagram
  • twitter
  • linkedin
  • facebook
W3 Coding Schools
  • Home
  • HTML
    • HTML Introduction
    • HTML Editors
    • Fundamentals of HTML
    • Elements of HTML
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Style Attribute
    • HTML Text Formatting
    • HTML Phrase Tags
    • HTML Comments
    • HTML with CSS
    • HTML Links
    • HTML Images
    • HTML Tables
    • HTML Lists
    • HTML Blocks
    • HTML Class Attribute
    • HTML Id Attribute
    • HTML Iframes
    • HTML JavaScript
    • HTML File Paths
    • HTML Head
    • Computer Code Elements
    • HTML Entities
    • HTML Charset
    • HTML URL Encode
    • HTML and XHTML
    • HTML Layouts
    • HTML Forms
    • HTML Form Elements
    • HTML Form Input Types
    • HTML Input Attributes
    • HTML5 Introduction
    • HTML5 New Elements
    • Semantic Elements
    • HTML5 Migration
    • Style Guide
    • HTML Canvas
  • CSS
    • CSS Introduction
    • CSS Syntax and CSS Comments
    • CSS Selectors
    • How to add CSS to a Webpage
    • CSS Color Basics
    • CSS Background Properties
    • CSS Border Properties
    • CSS Margin and Padding Properties
    • CSS Height and Width properties
    • CSS Box Model
    • CSS Outline Properties
    • CSS Fonts
    • CSS Text
    • How To Add Icons
    • CSS Links
    • CSS List-Style
    • CSS Tables
    • CSS Display Property
    • CSS Position Property
    • CSS Overflow Property
    • CSS max-width Property
    • CSS Float and Clear Properties
    • CSS Alignment
    • CSS inline-block
    • CSS Combinators
    • CSS Pseudo Classes
    • CSS Pseudo Elements
    • CSS Opacity
    • CSS Navigation Bar
    • CSS Dropdowns
    • CSS Image Gallery
    • CSS Image Sprites
    • CSS Attribute Selector
    • CSS Styling Forms
    • CSS Counters
    • CSS Units
    • CSS Specificity
    • CSS Website Layout
    • CSS Rounded Corners
    • CSS Border Image Property
    • CSS Multiple Backgrounds
    • CSS Gradient
    • CSS Shadow Effects
    • CSS Text Effects
    • CSS Web Fonts
    • CSS 2D Transforms
  • Bootstrap 4
    • Bootstrap 4 – Introduction
    • Bootstrap versions
    • Bootstrap 4 Layout
    • Bootstrap 3 Vs Bootstrap 4
    • Bootstrap 4 Grid System
    • Bootstrap 4 Typography
    • Bootstrap 4 Colors
    • Bootstrap 4 Images
    • Bootstrap 4 Tables
    • Bootstrap 4 Jumbotron
    • Bootstrap 4 Figures
    • Bootstrap 4 Alerts
    • Bootstrap 4 Buttons
    • Bootstrap 4 Button Group
    • Bootstrap 4 Badges
    • Bootstrap 4 Spinners
    • Bootstrap 4 Progress Bars
    • Bootstrap 4 Pagination
    • Bootstrap 4 Breadcrumbs
    • Bootstrap 4 List Groups
    • Bootstrap 4 Cards
  • jQuery
    • jQuery Introduction
    • jQuery Download
    • jQuery Selectors
    • jQuery Event Methods
    • jQuery Hide/Show Effects
    • jQuery Fading Effects
    • jQuery Sliding Effects
    • jQuery Animation
    • jQuery Stop and Callback
    • jQuery Get and Set Methods
    • jQuery Chaining
    • jQuery Add
    • jQuery Remove
    • jQuery CSS Classes
    • jQuery Style Properties
    • jQuery Dimensions
    • jQuery Traversing
    • jQuery Ancestors
    • jQuery Descendants
    • jQuery Siblings
  • Javascript
    • JS Introduction
    • JS Where to Put
    • JavaScript Syntax
    • JavaScript Comments
    • JavaScript Variables
    • JavaScript Data Types
    • JavaScript Operators
    • JavaScript Events
    • JavaScript Strings
    • JavaScript Numbers
  • php
    • PHP Introduction
    • Install PHP
    • PHP Syntax and Comments
    • PHP Variables
    • PHP Constants
    • PHP Echo and Print
    • PHP Data Types
    • PHP Strings
    • PHP Operators
    • PHP $ and $$ Variables
  • WordPress
    • WordPress Introduction
    • WordPress History
    • WordPress.com vs WordPress.org
    • How to Install WordPress
    • WordPress Dashboard
    • How to Create a WordPress Website
    • WordPress Posts
    • WordPress Pages
    • WordPress Posts vs Pages
    • WordPress Categories
  • SEO
    • SEO Introduction
    • SEO Tactics and Methods
    • SEO Relevant Filenames
    • SEO Domain Name
    • Website Design and SEO
    • SEO Keywords
    • Meta Tags Optimization
    • Title Tag Optimization
    • Anchor Text Optimization
    • Content Optimization
  • Android
    • Android Introduction
    • Android History and Versions
    • Android Architecture
    • Android Environment Setup
    • Android Application Components
    • Hello World Application
    • Android Activities
  • iOS
    • iOS Introduction
    • iOS Environment Setup
    • iOS Architecture

You Are Here

  • Home
  • Learn HTML
  • HTML Lists

Topics

  • HTML Introduction
  • HTML Editors
  • Fundamentals of HTML
  • HTML Elements
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Style Attribute
  • HTML Text Formatting
  • HTML Phrase Tags
  • HTML Comments
  • HTML with CSS
  • HTML Links
  • HTML Images
  • HTML Tables
  • HTML Lists
  • HTML Blocks
  • HTML Class Attribute
  • Id Attribute for HTML
  • HTML Iframes
  • HTML JavaScript
  • HTML File Paths
  • HTML Head
  • HTML Computer Code Elements
  • HTML Entities
  • HTML Charset
  • HTML URL Encode
  • HTML and XHTML
  • HTML Layouts
  • HTML Forms
  • HTML Form Elements
  • HTML Form Input Types
  • HTML Input Attributes
  • HTML5 Introduction
  • HTML5 New Elements
  • Semantic Elements in HTML5
  • HTML5 Migration
  • Style Guide
  • HTML Canvas
  • HTML SVG

Oct Champs & Prizes

  • 1. Pooja Ladda
  • 2. Manjali Kuldharan
  • 3. Pranali Surawar
  • 4. Anjali Kulkarni
  • 5. Vishal Deshmukh

Recent Posts

  • HTML Media
  • jQuery Siblings
  • Bootstrap 4 Cards
  • jQuery Descendants
  • jQuery Ancestors

HTML Lists

HTML lists are used to present a list of information in a well-formed and systematic way.
The list is nothing but a record of information.
HTML list has 3 different types:
  • Ordered List or Numbered List
  • Unordered List or Bulleted List
  • Description List or Definition List

HTML Ordered List or Numbered List:

If you want to put all your items in a numbered list then you can use the HTML ordered list.
The ordered list is created by using <ol> tag. The list items start with <li> tag. In the ordered list, the numbering starts from one and is incremented by one for each successive list element.

Example:

<ol>
<li> India </li>
<li> USA </li>
<li> Australia </li>
</ol>
Try it

The type Attribute for Ordered List:

You can use type attribute for <ol> tag to define the type of numbering you like. By default, it is a number. 
Following are the type attributes for ordered list:
<ol type = “1”>
<ol type = “I”>
<ol type = “i”>
<ol type = “A”>
<ol type = “a”>

Numbers:

The list items will be numbered with numbers i.e default.

Example:

<ol type=”1″>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Uppercase Roman Numbers:

The list items will be numbered with uppercase roman numbers.

Example:

<ol type=”I”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Lowercase Roman Numbers:

The list items will be numbered with lowercase roman numbers.

Example:

<ol type=”i”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Uppercase Letters:

The list items will be numbered with uppercase alphabets.

Example:

<ol type=”A”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Lowercase Letters:

The list items will be numbered with lowercase alphabets.

Example:

<ol type=”a”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Unordered HTML List:

In HTML, unordered lists are the lists that do not have any form of numbering and it is also known as a bulleted list.
The unordered list is created by using <ul> tag and each item in the list is marked with a bullet.
You can use the CSS list-style-type property to specify the list item marker.

Example:

<ul>
<li> India </li>
<li> USA </li>
<li> Australia </li>
</ul>
Try it

The type Attribute for Unordered List:

To represent different unordered lists, there are 4 types of attributes.
Following are the type attributes for unordered list:
<ul style=”list-style-type:disc;”>
<ul style=”list-style-type:circle;”>
<ul style=”list-style-type:square;”>
<ul style=”list-style-type:none;”>

Disc:

This is the default style. The list items will be displayed with bullets.

Example:

<ul style=”list-style-type:disc;”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ul>
Try it

Circle:

The list items will be displayed with the circles.

Example:

<ul style=”list-style-type:circle;”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ul>
Try it

Square:

The list items will be displayed with the squares.

Example:

<ul style=”list-style-type:square;”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ul>
Try it

None:

In this style, the list items are not marked only items will be displayed.

Example:

<ul style=”list-style-type:none;”>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ul>
Try it

Description list:

In HTML the description list or definition list is a list of items with a description of each item.
The <dl>, <dt> and <dd> tags are used to create description list. In description list <dl> tag defines the description list, <dt> tag defines data term and <dd> tag defines data definition or description.

Example:

<dl>
<dt> HTML </dt>
<dd> is a markup language </dd>
<dt>CSS</dt>
<dd> is used to define styles of web pages </dd>
<dt> Boostrap </dt>
<dd> is a CSS framework </dd>
<dt> JavaScript </dt>
<dd> is a scripting language </dd>
</dl>
Try it

Nested HTML List:

A list inside another list is known as a nested list.
If you want a number list inside bullet list then you can use this type of list and is is called as nested lists.

Example:

<ol>
<li> India </li>
<ul>
<li> New Delhi </li>
</ul>
<li> USA <ul>
<li> Washington, D.C. </li>
</ul>
</li>
<li> Australia </li>
<ul>
<li> Canberra </li>
</ul>
<li> Canada </li>
<ul>
<li> Ottawa </li>
</ul>
</ol>
Try it

The start Attribute:

The ordered list will start counting from 1 by default, if you want to start counting from a specific number, you can use the start attribute.

Example:

<ol start=”10″>
<li> India </li>
<li> USA </li>
<li> Australia </li>
<li> Canada </li>
</ol>
Try it

Creating Horizontal HTML List with CSS:

You can create a horizontal list in HTML, you just have to add display: inline property to make it horizontal.
Display: inline will display them horizontally and list-style-type: none will remove all bullets and numbers.
Most of the time horizontal lists are used to create a navigation menu.

Example:

<!DOCTYPE html >
<html>
<head>
<style>
ul#menus li {
display:inline;
}
</style>
</head>
<body>
<p> In this example, we use CSS to style the list horizontally. </p>
<ul id="menus">
<li> HTML </li>
<li> CSS </li>
<li> Javascript </li>
<li> Bootstrap </li>
</ul>
</body>
</HTML>
Try it
Note: You will learn more about the styling of lists in our CSS List Style topic.​

Post navigation

HTML Tables
HTML Blocks

Ask a Question Cancel reply

Your email address will not be published. Required fields are marked *

W3 CODING SCHOOLS © Copyright 2019-20
Privacy policy   Terms of use

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok