HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: ul

The HTML tag ul stands for unordered list. It is used to create a list of items that do not have a specific order or sequence. The items in an unordered list are typically displayed with bullet points or other symbols to indicate that they are separate items in the list.

The ul tag is often used in conjunction with the li tag, which stands for list item. Each item in the list is enclosed in an li tag, and the entire list is enclosed in a ul tag.

Here is an example of how to use the ul tag to create an unordered list:

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

This code will create an unordered list with three items:

  • Item 1
  • Item 2
  • Item 3

The ul tag can also be used to create nested lists, where one list is contained within another list. To create a nested list, simply enclose the inner list in another set of ul and li tags:

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

This code will create a nested list with two levels:

  • Item 1
  • Item 2
    • Subitem 1
    • Subitem 2
  • Item 3

The ul tag can also be styled using CSS to change the appearance of the list. For example, you can change the bullet points to different symbols or remove them altogether:

ul {
  list-style-type: none;
}

This code will remove the bullet points from the list:

  • Item 1
  • Item 2
  • Item 3

Overall, the ul tag is a useful tool for creating lists of items in HTML. Whether you need a simple list or a complex nested list, the ul tag can help you organize your content and make it more readable for your users.

References

Activity