Ordered List

 

HTML Ordered List

  • An ordered list is used to create a list of items in a specific order, typically indicated by numbers.

Syntax

cwh tutorial image

Key Points

  • Ordered lists are used for items that follow a sequence.

  • They are created using the <ol> (Ordered List) tag.

  • The list items are enclosed within <li> (List Item) tags.

Basic Example

<ol>
  <li>Mango</li>
  <li>Orange</li>
  <li>Litchi</li>
</ol>

Output:

  1. Mango
  2. Orange
  3. Litchi

Setting the 'type' Attribute

The type attribute specifies the style of numbering. You have several options


  1. Uppercase Roman Numerals: Use type="I"
  2. Lowercase Roman Numerals: Use type="i"
  3. Arabic Numerals: Use type="1" (This is the default if the type the attribute is not specified)
  4. Lowercase Alphabetical Letters: Use type="a"
  5. Uppercase Alphabetical Letters: Use type="A"

Setting the 'start' Attribute

The start attribute specifies the starting number for the list.

<ol type="A" start="3">
  <li>Pen</li>
  <li>Pencil</li>
</ol>

Output:

  1. Pen
  2. Pencil

Related Posts:

  • Link & Script TagsThe <link> and <script> tags are essential elements within an HTML document's <head> section. The… Read More
  • Video & Audio Tags<video> TagThe <video> HTML element embeds a media player that supports video playback into the document.The <video> tag create… Read More
  • Textarea & Select Textarea ElementThe textarea element is used when you need multiline text input from the user. This is particularly useful for comment… Read More
  • iFrames in HTMLWhat is an iFrame?An iFrame is an HTML element that enables an inline frame for the embedding of external content. Essentially, you can load another w… Read More
  • SVG in HTML What is SVG?SVG stands for Scalable Vector Graphics. Unlike raster images like PNGs or JPGs, SVGs are not pixel-based. They're composed of vector… Read More

0 Comments:

Post a Comment

Do leave your comments