totn HTML

HTML: <ul> tag

This HTML tutorial explains how to use the HTML element called the <ul> tag with syntax and examples.

Description

The HTML <ul> tag defines an unordered list in the HTML document. This tag is also commonly referred to as the <ul> element.

Syntax

In HTML, the syntax for the <ul> tag is:

<body>
<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>
</body>

Sample Output


Attributes

In addition to the Global Attributes, the following is a list of attributes that are specific to the <ul> tag:

Attribute Description HTML Compatibility
compact Boolean value indicating that the list should be rendered in a compact style Deprecated, use CSS
type Bullet style for the list. It can be any of the following values: circle, disc, square. Use CSS list-style-type property instead. Deprecated, use CSS

Note

  • The HTML <ul> element is found within the <body> tag.
  • The <ul> tag is made up of <li> tags.
  • Use the <ul> tag when the list items have no numerical ordering.
  • You can nest <ol>, <ul> and <menu> lists.

Browser Compatibility

The <ul> tag is compatible with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the <ul> tag below, exploring examples of how to use the <ul> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.