HTML has code you can use that allows you to make a "bulleted" or "numbered" list. There are two different types of list tags. The <ol> (ordered list) and <ul> (unordered list). Ordered lists are lists that order items by numbers or roman numerals. Unordered lists are bulleted points that can have circles or squares instead of numbers. Each ordered and unordered list has <li> elements within it. The <li> tags display each list item.

Code for the Ordered list

First, let's discuss "Ordered Lists". Ordered lists will be numbered and we will start with the <ol> tag.

<ol></ol>

This is the opening tag to tell the web browser the following content is to be contained in an ordered list. Now, we will need to add an <li> tag which stands for list item. After adding the list item tags and closing them our code will look like this. Don't forget to close the tags.

<ol>
  <li>first line in the list </li>
  <li>second line in the list </li>
</ol>

The above code will display the following results:

  1. first line in the list
  2. second line in the list

Code for the Unordered list

The process is the same for the unordered list. The only difference is the opening and closing tag of the actual list. Don't forget to close your tags or the lists will not display correctly. 

<ul>
  <li>first line in the list </li>
  <li>second line in the list </li>
</ul>

The above code will display the following results:

  • first line in the list
  • second line in the list

list styles in ordered and unordered lists

There are different style properties you can use for your lists. You can make the list style disc, square, circle etc.

<ul style="list-style: square">
  <li>first line in the list </li>
  <li>second line in the list </li>
</ul>

The above code will display the unordered list with squares:

  • first line in the list
  • second line in the list

The ordered list can have alpha, roman or other numeric style lists. The following in how the code works.

<ol style="list-style: upper-roman">
  <li>first line in the list </li>
  <li>second line in the list </li>
</ol>

The above code will display the ordered list with Upper case Roman numerals:

  1. first line in the list
  2. second line in the list

List of CSS list-style properties

Ordered CSS properties
lower-alpha
lower-roman
lower-latin
lower-greek
upper-alpha
upper-roman
upper-latin
upper-greek
CSS property to hide the list style
none
Unordered CSS properties
disc
square
circle

If you missed our previous article, please see the Basic Style using the Tag tutorial. For more information on this course please visit Website Design Basics

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm James Richardson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

We've been listening!

2013-02-07 10:55 am
Revamped this article to include more information on the subject.

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Please help--I'm trying to get a script to work.
  2. i would like to know how to set up phpmailer to email from a mysql database
  3. I can't access my website

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!