English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The HTML <ul> tag defines an unordered list in an HTML document. This tag is also commonly referred to as the <ul> element.
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.
IEFirefoxOperaChromeSafari
All mainstream browsers support the <ul> tag.
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.
Tip:Use CSS to define the style of the list.
Tip:Use<ol> tags to create ordered lists.
The difference between HTML 4.01 In HTML, the "compact" and "type" attributes are deprecated. HTML5 Then these two attributes are not supported.
Attribute | Value | Description |
---|---|---|
compact | compact | HTML5 Not supported. HTML 4.01 Deprecated. Specify a list that appears more compact than the default. |
type | disc square circle | HTML5 Not supported. HTML 4.01 Deprecated. Specify the type of bullet for list items. |
<ul> tag supports HTML Global Attributes.
<ul> tag supports HTML Event Attributes.
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.
HTML Tutorial:HTML Lists