Thursday, June 4, 2009

Using HTML Lists

. Thursday, June 4, 2009

How to add an HTML list to your page
Have you been wanting to add lists to your page? Well, here is the way to add those HTML lists to your Web pages.
To begin, we need a tag to begin and end the entire list. For starters, let's use an unordered list. This will create a list with bullets next to the list items. The opening tag is <ul>, and the closing tag is... yep, you guessed it... </ul>. Now, to set off each item in your list, you use the <li> tag, followed by your text, then close each list item with the </li> tag. Here is a sample list with two list items:
<ul>
<li>I am item one</li>
<li>I am item two</li>
</ul>
This will give us the bulleted list below:
I am item one
•I am item two
Notice the list is indented somewhat from the rest of the text.
You can also use the type attribute to specify the type of bullets to be used in the list. The possible types are listed below:
Type Description
disc The default. Uses a plain colored-in disc.
circle Uses a hollow circle.
square Uses a colored-in square.
So, if you want to use the square type of bullet, you could do the following:
<ul type="disc">
<li>Disc 1</li>
<li>Disc 2</li>
</ul>
Which will give you the following list:
οDisc 1
οDisc 2
You can also use an ordered list in the same way you use the unordered list. Instead of using <ul><
/ul>, you would use <ol></ol>, like this:
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
This gives you a numbered list rather than the bulleted list:
1.Item 1
2.Item 2
3.Item 3
You can use the type attribute to specify the type of numbering/lettering system to be used in the ordered list. The types are listed below:
Type Description
1 The default. Uses Arabic numerals.
I Uses uppercase Roman numerals.
i Uses lowercase Roman numerals.
A Uses uppercase letters.
a Uses lowercase letters.
So, if you want to use uppercase Roman numerals, you could do the following:
<ol type="I">
<li>Roman I</li>
<li>Roman II</li>
</ol>
Which will give you the following list:
I. Roman I
II. Roman II
Well, that does it for HTML lists, so lets go on to the next section:
Using the Body Tag Attributes.

0 komentar:

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment

 
Namablogkamu is proudly powered by Blogger.com | Template by o-om.com