Jan Leow's Press Blog


HTML Lesson 5: making list

You may want to make a list for easier presentation of information on your website. There are two types of list, unordered bulleted list and ordered numbered list.

To create the unordered list, you will use the “UL” tag together with the list item “LI” tag. There is no need to close the “LI”, as mentioned previously, not every tag will require a closing tag. However, you may still want to close the tag by using “/LI” for the sake of XML convention which requires a closing tag.

<UL>

<LI>List item

<LI>List item

<LI>List item

</UL>


Will become:


  • List item
  • List item
  • List item


Similarly for the order numbered list.

<OL>
<LI>List item
<LI>List item
<LI>List item
</OL>


Will become:


  1. List item
  2. List item
  3. List item


You can also nest the list:

<OL>

<LI>List item

    <OL>

    <LI>List item

    <LI>List item

    </OL>

<LI>List item

<LI>List item

    <UL>

    <LI>List item

    <LI>List item

    <LI>List item

    </UL>

<LI>List item

</OL>


The display result:


  1. List item

    1. List item
    2. List item
    3. List item

  2. List item
  3. List item

    • List item
    • List item
    • List item

  4. List item



Leave a Comment

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

Blue Captcha Image
Refresh

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.