October 22, 2011

Ordered List

Ordered List is also called numbered list. This type of list can be used when the order of items to list is significant. It could be used if you want to list the steps in cooking or preparing a recipe, with ordered list each list items are emphasized in order; alphabetically or numerically. An ordered list can be made with different styles; Arabic numbers (1, 2, 3, …), lowercase or uppercase letters (A, B, C…), or lowercase or uppercase Roman numerals (I, II, III, …). The following code shows examples for each of these types: (You may type the code on your text editor to see it yourself.)

<html>
<head><title>
Ordered List 2</title></head>
<body>
<p>Arabic Numbers:</p>
<ol>
<li>Google.com</li>
<li>Yahoo.com</li>
<li>Facebook.com</li>
</ol>

<p>Uppercase Alphabet:</p>
<ol type="A">
<li>Google.com</li>
<li>Yahoo.com</li>
<li>Facebook.com</li>
</ol>

<p>Lowercase Alphabet:</p>
<ol type="a">
<li>Google.com</li>
<li>Yahoo.com</li>
<li>Facebook.com</li>
</ol>

<p>Uppercase Roman Numbers:</p>
<ol type="I">
<li>Google.com</li>
<li>Yahoo.com</li>
<li>Facebook.com</li>
</ol>

<p>Lowercase Roman Numbers:</p>
<ol type="i">
<li>Google.com</li>
<li>Yahoo.com</li>
<li>Facebook.com</li>
</ol>
</body>
</html>

Code as displayed in the browser.

About the code:
  • The <ol> tells the browser to start an ordered list.
  • The <li> tag is used to list each item in the list.
  • The </li> tag is used to end the list item.
  • The </ol> tag instructs the browser that the ordered list has ended.
  • The attribute type=”1” is used to create an Arabic Numbered list.
  • The attribute type=”A” is used to create a list using an uppercase alphabet.
  • The attribute type=”a” is used to create a list using a lowercase alphabet.
  • The attribute type=”I” is used to create a list using an uppercase Roman number.
  • The attribute type=”i” is used to create a list using a lowercase Roman number.

0 comments: