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

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.

overview

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:

Style Your Ordered List image 1

2. ol element

Style the ol element:

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

The list will become like this:

Style Your Ordered List image 2

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 image 3

View my demo file to see more samples.



Author's URL: Web Designer Wall
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

HTML is Hyper Text Markup Language that is used to make hypermedia and hypertext documents for the Web. More HTML and CSS: Most Popular Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

Add comments to "Style Your Ordered List"

Only registered users can write comment

Reader's comments