What is the <ul> element in HTML?

The <ul> element in HTML represents an unordered list. The <ul> element is typically used with the <li> element to create a bulleted list.

The <ul> element may be nested as deeply as you desire. Similar to most HTML elements, the <ul> element can be styled using CSS.

Attributes and events

The <ul> element includes only global attributes and supports all the usual events supported by HTML elements.

Example

The code below shows how the <ul> element works in HTML:

Explanation

The code above shows three different examples of how to use the <ul> element.

The first example in line 1111 creates a simple unordered list with 33 items. Each <li> element represents a single item. Since all the <li> elements are nested within the <ul> element, the list has no particular order.

In the second example in line 1919, the <ul> element creates a nested list of unordered items. Each <li> element contains another <ul> element within itself, which allows for the sub-items to be rendered.

The third example in line 3636 is similar to the second example. However, this time, the <ol> element is used to create an ordered list of sub-items. The main item list remains unordered since everything is nested within the <ul> element.

Note: For further details regarding the <ul> element, you can check the documentation.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved