www.casino.nf All Tricks and Tips,PHP,HTML,.NET,SEO,XML

HTML Lists


                          HTML Lists


HTML offers authors several mechanisms for specifying lists of information

There are 3 different types of lists.
  • <ul> - unordered list; bullets
  • <ol> - ordered list; numbers
  • <dl> - definition list; dictionary  


Unordered Lists

An unordered list is a list of items. With bullets the list items are marked (typically small black circles).

An unordered list starts with the <ul> tag.
Each list item starts with the <li> tag.
<ul>
    <li>list item1</li>
    <li>list item2</li>
</ul>
In three flavors the bullet comes :
squares    <ul type="square">
discs    <ul type="disc">
circles    <ul type="circle">
<ul type="square">
    <li>list item1</li>
    <li>list item2</li>
</ul>
O/P:
  • list item1
  • list item2
<ul type="disc">
    <li>list item1</li>
    <li>list item2</li>
</ul>
O/P:
  • list item1
  • list item2
<ul type="circle">
    <li>list item1</li>
    <li>list item2</li>
</ul>
O/P:
  • list item1
  • list item2


Ordered Lists

An ordered list is also a list of items. The list items are marked with numbers.

An unordered list starts with the <ol> tag.
Each list item starts with the <li> tag.
<ol>
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2
Using the start attribute start your ordered list on any number besides 1.
<ol start="4" >
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2
There are 4 other types of ordered lists. You can replace generic numbers with
Roman numberals or letters,both capital and lower-case.
Use the type attribute to change the numbering.
<ol type="a">
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2
<ol type="A">
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2
<ol type="i">
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2
<ol type="I">
    <li>list item1</li>
    <li>list item2</li>
</ol>
O/P:
  1. list item1
  2. list item2


Definition Lists

A definition list is not a list of items. This is a list of terms and explanation of the terms.

A definition list starts with the <dl> tag.
Each definition-list term starts with the <dt> tag.
Each definition-list definition starts with the <dd> tag.
<dl>
    <dt>Definition list term1</dt>
    <dd>Definition list definition1</dd>
    <dt>Definition list term1</dt>
    <dd>Definition list definition1</dd>
</dl>
O/P:
Definition list term1
Definition list definition1
Definition list term2
Definition list definition1