OL Tag HTML

OL TAG- This type of list are Ordered or Numbered list and these are marked by tag <OL> and </OL> and <li> to write list items.

<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<OL>
<li> Apple
<li> Mango
<li> Banana
</OL>
</BODY>
</HTML>


Output:

Attributes of OL Tag
  • Type
  • Start
Type- By using this attribute of <OL> tag we can specify the type of ordered list. By using following values (A, a, I, i, 1).

A - for numbering with capital letters
a - for numbering with lower case letters
I - for numbering with capital Roman numbers
i - for numbering with lower case Roman numbers
1 - for numbering with common Arabic numbers

<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<OL type="A">
<li> Apple
<li> Mango
<li> Banana
</OL>
<OL type="a">
<li> Apple
<li> Mango
<li> Banana
</OL>
<OL type="I">
<li> Apple
<li> Mango
<li> Banana
</OL>
<OL type="i">
<li> Apple
<li> Mango
<li> Banana
</OL>
<OL type="1">
<li> Apple
<li> Mango
<li> Banana
</OL>
</BODY>
</HTML>

Output:

Start- By using this attribute of <OL> tag we can change beginning value of list item.

If we want to start numbering list at 5 then we can use start attribute as follows:-

<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<OL start=5>
<li> Apple
<li> Mango
<li> Banana
</OL>
</BODY>
</HTML>

Output:

UNIT-205
HTML Fundamentals
  1. Introduction to HTML
  2. HTML document structure
  3. Creating an HTML document
  4. Containers and empty elements
HTML Elements
  1. HTML, HEAD, TITLE, BODY
  2. Attributes of Body Element: Background, Bgcolor, Text, Link, Alink, Vlink, Leftmargin, Topmargin
  3. FONT (Attributes of FONT Element: Color, Size, Face)
  4. IMG (Attributes of IMG Element: Src, Width, Height, Alt, Align)
  5. BASEFONT (Attributes of BASEFONT Element: Color, Size, Face)
  6. CENTER, BR
  7. HR (Attributes of HR Element: Width, Align, Noshade, Color, Size, Face)
  8. H1-H6 (Heading Elements)
  9. P (Paragraph), B (Bold), I (Italics), U (Underline)
  10. UL (Unordered List) Attributes of UL: Type 
  11. OL (Ordered List) Attributes of OL: Type, Start
  12. Linking Internal and External Linking
  13. A (Anchor) Attributes of A Element: Href, Title, Name, Alt
  14. TABLE (Attributes of TABLE Element: Td, Th, Tr)