Home HTML HTML List

HTML List

List Tag

HTML provides several tags for creating lists, including ordered lists (<ol>) and unordered lists (<ul>).

Unordered List (<ul>):

An unordered list is a list of items that are marked with bullet points, and is created using the <ul> tag. Each list item is enclosed in a <li> tag.

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

				
			

Ordered List (<ol>):

An ordered list is a list of items that are marked with numbers, and is created using the <ol> tag. Each list item is enclosed in a <li> tag. Here is an example:

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

				
			

Nested List:

You can also create nested lists, where you can have lists inside lists.

				
					<ul>
  <li>Item 1
    <ul>
      <li>Item 1.1</li>
      <li>Item 1.2</li>
    </ul>
  </li>
  <li>Item 2
    <ul>
      <li>Item 2.1</li>
      <li>Item 2.2</li>
    </ul>
  </li>
  <li>Item 3</li>
</ul>

				
			

You can also style your lists using CSS, for example you can change the bullet points, numbers, or change their color, font, and so on.

It’s important to use lists correctly, as they make your content more readable and easy to understand for users. It’s good practice to use lists when you have a group of related items, rather than separating them with commas or semicolons.

Scroll to Top