Share on Google+Share on Google+

HTML5 <ol> tag, Example of <ol> tag in html 5

Advertisement
In this tutorial, We will discuss about <ol> tag in html5.

HTML5 <ol> tag, Example of <ol> tag in html 5

In this tutorial, We will discuss about <ol> tag in html5. The <ol> tag is used for defining a ordered list. The ordered list is represented as listing by number serially. We can change the number from that serial is starts in the ordered list by using "start" attribute. In The ordered list the list is created by <li> tag and <ol> tag must have opening and closing tag. 

Declaration Syntax:

The syntax for the <ol> tag is as:

<ol>List Of  Items Here </ol>

This tag have two specific attributes are as:

start="value"    This attribute value specify the list value of the first list item. The number must be a ordinal value.

reversed="value"  This attribute indicates that the list item is in descending if present and in ascending if not present.

Example: orderlist_tag.html.

<!DOCTYPE html>
<html>
  <head>
      <title>Example of orderlist Tag</title>
  </head>
  <body>
  <ol start="5" >
          <li>Gyan</li>
          <li>Ankit</li>
          <li>Bikrant</li>
  </ol>
  </body> 
</html>

Output:

Download This Example:

Difference Between html5 and html4.01.

The reversed attribute is the new introduction in html5. start attribute is not supported by html4.01 but html5 support it.

Advertisements

Posted on: September 10, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.