Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials Style Your Ordered List

Style Your Ordered List


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.



Author's URL: Web Designer Wall
Learn HTML step-by-step from A to Z or improve your professional skills. More Tutorials: Featured Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com


Like us to: