Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Elements

0/1

HTML Attributes

0/1

HTML Headings

0/1

HTML Paragraphs

0/1

HTML Styles

0/1

HTML Formatting

0/1

HTML Quotation

0/1

HTML Comments

0/1

HTML Colors

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Block and Inline

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML - The Head Element

0/1

HTML Style Guide

0/1

HTML Entities

0/1

HTML Symbols

0/1
Text lesson

Ordered Lists

Ordered HTML List

Commencing with the <ol> tag, an ordered list is initiated. Each item within the list is identified with the <li> tag.

By default, the list items are numbered.

Example

<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Ordered HTML List – The Type Attribute

The type attribute of the <ol> tag determines the style of the list item marker.

Type

                                 Description

type=”1″

                 The default numberinf for list items will be numerical.

type=”A”

                 The list items will be numbered using uppercase letters

type=”a”

                The list items will be numbered using lowercase letters

type=”I”

                The list items will be numbered using uppercase roman numbers

type=”i”

                 The list items will be numbered using lowercase roman numbers

Numbers:

<ol type=”1″>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Uppercase Letters:

<ol type=”A”>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Lowercase Letters:

<ol type=”a”>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Uppercase Roman Numbers:

<ol type=”I”>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Lowercase Roman Numbers:

<ol type=”i”>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Control List Counting

By default, an ordered list begins counting from 1. If you wish to start counting from a specific number, you can utilize the start attribute.

Example

<ol start=”50″>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Nested HTML Lists

Lists have the capability to be nested, meaning one list can be contained within another.

Example

<ol>
  <li>Coffee</li>
  <li>Tea
    <ol>
      <li>Black tea</li>
      <li>Green tea</li>
    </ol>
  </li>
  <li>Milk</li>
</ol>
Certainly! An item in a list (<li>) can encompass a new list as well as other HTML elements such as images, links, and more.

Summary of the Chapter

  • Utilize the HTML <ol> element for defining an ordered list.
  • Employ the HTML type attribute to specify the numbering format.
  • Employ the HTML <li> element to denote individual list items.
  • Lists have the capability to be nested
  • List items can encompass various other HTML elements.

 

Click to Learn