Ordered lists, as with the un-ordered list are similar to bullet points. The main difference is that the lists auto number - incrementing by 1 for each item in the list. Take a look a the following table.
type | dir | start |
|
|
|
html code | ||
<ol type="1"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ol> |
<ol type="1" dir="rtl"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ol> |
<ol type="1" start="20"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ol> |
3 main attributes can be set for ordered lists they are type dir and start.
The type attributeThere are 5 list syles you can use. Heres an example.
The start option allows you to set the number at which the list will start counting.
Here's an example of why you would want to set the start number.
Event Schedule
Todays schedule will be as follows
After a break for lunch the schedule will continue with..
You can all go home now :) |
OK, it's not a great example but it does prove the point. The page has 2 lists with a paragraph of text in between them. Using the start attribute allows us to break out of a list for whatever reason and continue with the list again later on by setting the start attribute.
The dir attributeThe default value if none specified is the same as dir="ltr" - left to right. So, dir="rtl" is right to left :)