Learning HTML Part 9 : How to Create a List in HTML (tags ol, ul and li)

0

The next step we will learn in Learning HTML Part 9 : How to Create a List in HTML (tags ol, ul and li). To display a text as a list, HTML provides Tags <ol>, <ul>and<li>.

How to create a List in HTML

In HTML, a tag list consists of 2 types, ordered list (sequence) and unordered list (no order). ordered list will be displayed with numbers or letters, whereas the unordered list with a circle or box.

ordered list using the tag <ol>, and unordered list using tags <ul>, as for the list itself using the tag <li>. This explanation will be easier if you use the example.

Here is an example HTML code to create an ordered list using the tag <ol> :

See the Pen Ordered list using the tag <ol&rt; by webspoints (@webspoints) on CodePen.

To create unordered list, just replace the tag <ol> into <ul>.
Here is an example of HTML code for creating an unordered list using the tag <ul> :

See the Pen Unordered list using the tag <ul&rt; by webspoints (@webspoints) on CodePen.

The use of the tag list in HTML not only to list only. With CSS, the tag list can be used to create a navigation menu in a web page, such as menu home, contact us, etc. The tag list can also be used for the nested list, or the list of nested, meaning that a list in the other list.

Learning basic HTML tutorial in the next, we will discuss one of the most important tags from HTML <a> tags, i.e. to Create links in HTML.

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here