HTML <ul> Tag

Last Updated : 22 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

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: 

AttributeDescription
HTML <ul> compact AttributeRenders the list smaller.
HTML <ul> type AttributeSpecifies 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.

HTML
<!DOCTYPE html>
<html>

<body>
    <h2>Welcome To GeekforGeeks</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.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>HTML ul tag</title>
</head>

<body>
    <h1>GeeksforGeeks</h1>
    <h2>HTML ul tag</h2>

    <p>GeeksforGeeks courses List:</p>

    <ul>
        <li>Geeks</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.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Nested unordered list</title>
</head>

<body>
    <h2>Welcome To GeeksforGeeks</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

Similar Reads

Which tag is used to represent progress of a task in HTML & how is it different from &lt;meter&gt; tag ?
In this article, we will see which tag is used to represent the progress of a task in HTML. To represent the progress of a task, we will use the &lt;progress&gt; tag. This tag is used to represent the progress of a task. It is also defined how much work is done and how much is left. Syntax: &lt;progress attributes...&gt; &lt;/progress&gt; Attribute
2 min read
Is container tag same as the empty tag in HTML? If not, why ?
In this article, we will see the container tag &amp; empty tag in HTML, along with knowing how they're different from each other. The Container tag is not the same as the empty tag &amp; these are two different categories of tags used in HTML. Container tag: This tag contains 3 parts, namely, the opening tag, content that will be displayed in the b
5 min read
Why &lt;big&gt; tag is not in HTML5 while &lt;small&gt; tag exists ?
The &lt;big&gt; tag was discontinued in HTML5 while &lt;small&gt; tag is still in handy because &lt;small&gt; tag is frequently used to represent small prints like footnotes, copyright notices, comments etc. Many alternatives for &lt;big&gt; tag are already available such as &lt;h1&gt;, &lt;h2&gt; and so on. In HTML5 instead of using &lt;big&gt;, y
2 min read
Explain the difference between head Tag and header Tag in HTML5 ?
The &lt;head&gt; element is a container for metadata and is placed between the &lt;html&gt; and &lt;body&gt; tags. The &lt;header&gt; is for the main content section's introductory elements, like headings or logos and it mainly focuses on what appears at the top of the webpage. &lt;head&gt; ElementThe &lt;head&gt; element is part of the HTML docume
1 min read
What is the difference between the &lt;br&gt; Tag and the &lt;p&gt; Tag ?
The &lt;br&gt; tag is used to insert a line break, creating a new line within text or content. It doesn't have a closing tag and is a self-closing tag. On the other hand, the &lt;p&gt; tag defines a paragraph, separating blocks of text. It has an opening &lt;p&gt; and a closing &lt;/p&gt; tag, allowing for the structured organization of text into p
2 min read
Difference between &lt;article&gt; tag and &lt;section&gt; tag
Both the tags are semantics in HTML 5. In this article, we will discuss about the &lt;article&gt; and &lt;section&gt; tag. Both the &lt;article&gt; and &lt;section&gt; tags are represented similarly but used for some meaning, that meaning is for the browsers and the developers. Both tags can replace each other as there will be no changes to the out
4 min read
What purpose does a &lt;script&gt; tag serve inside of a &lt;noscript&gt; tag?
Usage of NoScript tag: The tag defines alternate content that will be displayed if the user has disabled script or browser does not support script. It can be used inside both &lt;head&gt; and &lt;body&gt; tag. Syntax: &lt;noscript&gt; Contents... &lt;/noscript&gt; Example: [GFGTABS] HTML &lt;html&gt; &lt;head&gt; &lt;title&gt;wbr Tag&lt;/title&gt;
1 min read
HTML &lt;html&gt; Tag
HTML is a language full of diverse elements, and one such element is the &lt;html&gt; tag. This tag, standing for ‘HyperText Markup Language’, is used to define the root of an HTML or XHTML document. It serves as the main container for all other HTML elements, excluding the &lt;!DOCTYPE&gt; declaration. Understanding the &lt;html&gt; TagThe &lt;htm
2 min read
HTML | &lt;noframes&gt; Tag
The &lt;noframes&gt; tag is the backup for those browsers that does not support frames. This tag can contains all the element that can be placed in &lt;body&gt; tag. It is used to create link with the non-frame set version of any website where you want to display a message to the user. This &lt;noframes&gt; tag is not supported in HTML5. Syntax:
1 min read
HTML &lt;hgroup&gt; Tag
The &lt;hgroup&gt; tag in HTML stands for heading group and is used to group the heading elements. The &lt;hgroup&gt; tag in HTML is used to wrap one or more heading elements from &lt;h1&gt; to &lt;h6&gt;, such as the headings and sub-headings. The &lt;hgroup&gt; tag requires the starting tag as well as ending tag. Note: &lt;hgroup&gt; is deprecate
1 min read
three90RightbarBannerImg