HTML <ul> Tag

Topic: HTML5 Tags Reference« Prev|Next »

Description

The <ul> (short for unordered list) element defines an unordered list of items. Each list item is defined by a <li> element. Typically, unordered-list items are displayed with a bullet like a dot, a circle or a squared in front of it. However, the bullet style can be controlled with CSS, using the list-style-type property.

The following table summarizes the usages context and the version history of this tag.

Placement: Block
Content: One or more <li> elements
Start/End Tag: Start tag: required, End tag: required
Version: HTML 2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <ul> tag is given with:

HTML / XHTML: <ul> ... </ul>

The example below shows the <ul> tag in action.

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

Tag-Specific Attributes

The following table shows the attributes that are specific to the <ul> tag.

Attribute Value Description
type circle
disc
square
Obsolete Defines the shape of the bullets used for each list item.
compact compact Obsolete This Boolean attribute specifies that the list should be rendered in a compact style.

Global Attributes

Like all other HTML tags, the <ul> tag supports the global attributes in HTML5.


Event Attributes

The <ul> tag also supports the event attributes in HTML5.


Browser Compatibility

The <ul> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: HTML Lists.

Related tags: <li>, <ol>.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.