Her

Home HTML and CSS Tutorials Style Your Ordered List

Style Your Ordered List

Author: Web Designer Wall Author's URL: www.webdesignerwall.com More by this author

Overview

Basically, what we need to do is style the ol element to Georgia font, and then reset the p element (nested in ol) to Arial.

image 1

1. HTML source code

Make an ordered list. Don't forget to wrap your text with a <p> tag.

<ol>
 <li>
   <p>This is line one</p>
 </li>
 <li>
   <p>Here is line two</p>
 </li>
 <li>
   <p>And last line</p>
 </li>
</ol>

Here is how the default ordered list will display:

image 2

2. ol element

Style the ol element:

ol {
     font: italic 1em Georgia, Times, serif;
     color: #999999;
}

The list will become like this:

image 3

3. ol p element

Now style the ol p element:

ol p {
     font: normal .8em Arial, Helvetica, sans-serif;
     color: #000000;
}

Your final list should look like this:

Style Your Ordered List

View my demo file to see more samples.