HTML <ul> Tag
The HTML <ul> tag defines an unordered (bulleted) list. Use the <ul> tag together with the <li> tag to create unordered lists. List items (<li>) are nested within <ul>, allowing the display of items without a specific order, typically represented by bullet points in browsers.
Syntax:
<ul> list of items </ul>
Accepted attribute
This tag contains two attributes which are listed below:
Attribute | Description |
---|---|
HTML <ul> compact Attribute | Renders the list smaller. |
HTML <ul> type Attribute | Specifies the kind of marker used in the list. Values include disc , circle , square , etc. |
Note: The <ul> attributes are not supported by HTML 5.
HTML <ul> Tag Examples
Example 1: In this example, we have created an unordered list of computer parts using the <ul> tag.
<!DOCTYPE html>
<html>
<body>
<h2>Welcome To GeekforBeginner</h2>
<ul>
<li>Mouse</li>
<li>Keyboard</li>
<li>Speaker</li>
<li>Monitor</li>
</ul>
</body>
</html>
Output:
HTML Unordered List
Example 2: This example describes the Unordered List in HTML.
<!DOCTYPE html>
<html>
<head>
<title>HTML ul tag</title>
</head>
<body>
<h1>w3wiki</h1>
<h2>HTML ul tag</h2>
<p>w3wiki courses List:</p>
<ul>
<li>Beginner</li>
<li>Sudo</li>
<li>Gfg</li>
<li>Gate</li>
<li>Placement</li>
</ul>
</body>
</html>
Output:
HTML Unordered List
Example 3: Nested unordered list, a list inside other lists is known as a nested list.
<!DOCTYPE html>
<html>
<head>
<title>Nested unordered list</title>
</head>
<body>
<h2>Welcome To w3wiki</h2>
<ul>
<li>Hardware</li>
<li>
Software
<ul>
<li>System Software</li>
<li>Application Software</li>
</ul>
</li>
<li>MacBook</li>
</ul>
</body>
</html>
Output:
Nested Unordered List
Supported Browsers:
- Google Chrome
- Internet Explorer
- Microsoft Edge 12 and above
- Firefox 1 and above
- Safari
- Opera
Contact Us