English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML: <ul> tag

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

Online example

ul unordered HTML list:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML ul tag usage (Basic Tutorial Website w3(codebox.com)</title>
</head>
<body>
<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ul>
</body>
</html>
Test to see ‹/›

In this HTML5In the document example, we used the <ul> tag to create an unordered list containing four list items found in four <li> tags.

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <ul> tag.

Definition and usage instructions for tags

The <ul> tag defines an unordered list.

The <ul> tag is combined with <li> Tags are used together to create an unordered list.

The <ul> tag is composed of <li> tags.

Use the <ul> tag when the list items do not have a numbered sequence.

You can nest <ol>, <ul>, and <menu> lists.

Tips and Notes

Tip:Use CSS to define the style of the list.

Tip:Use<ol> tags to create ordered lists.

HTML 4.01 and HTML5between

The difference between HTML 4.01 In HTML, the "compact" and "type" attributes are deprecated. HTML5 Then these two attributes are not supported.

Attribute

AttributeValueDescription
compactcompactHTML5 Not supported. HTML 4.01 Deprecated. Specify a list that appears more compact than the default.
typedisc
square
circle
HTML5 Not supported. HTML 4.01 Deprecated. Specify the type of bullet for list items.

Global Attributes

<ul> tag supports HTML Global Attributes.

Event Attributes

<ul> tag supports HTML Event Attributes.

Try Online Example

Different Types of Unordered Lists
This example demonstrates different types of unordered lists.

Nested Lists
This example demonstrates how to nest lists.

Nested Lists 2
This example demonstrates more complex nested lists.

Custom List
This example demonstrates a definition list.

Related Articles

HTML Tutorial:HTML Lists