HTML Lists

Valid values for id attribute

In html two different lists of elements are present i.e. unordered list and ordered list.

Unordered lists:

This lists enclosed with <ul> element and are bullet lists.

 <ul>
 <li>List 1</li>
 <li>List 2</li>
 <li>List 3</li>
 </ul>

You can also change the type of bullet i.e.

 <ul type="square"><li>...</li></ul>
 <ul type="circle"><li>...</li></ul>
 <ul type="disc"><li>...</li></ul>

Ordered lists:

These are used to create a numbered lists.

 <ol>
 <li>List 1</li>
 <li>List 2</li>
 <li>List 3</li>
 </ol>

You can also change the type of number i.e.

 <ol type="a"><li>...</li></ol>
 <ol type="i"><li>...</li></ol>
 <ol type="1"><li>...</li></ol>

Here is another tricks:

 <ol type="a" start="3"><li>...</li></ol>
 <ol type="i" start="3"><li>...</li></ol>
 <ol type="1" start="3"><li>...</li></ol>

Output:

c. […]
iii. […]
3. […]

Leave a Reply

Your email address will not be published. Required fields are marked *