Skip to content

WebDevHubs

  • Home
  • HTML
  • CSS
  • JavaScript
  • Web Technologies
  • Web Templates
  • Toggle search form

HTML Unordered Lists

Posted on March 18, 2025March 18, 2025 By Jyoti No Comments on HTML Unordered Lists

An unordered list is a collection of items where the order of items does not matter. By default, the item of an unordered list is marked with a bullet point (•).

The unordered list items are created using <ul> and <li> elements. The <li> elements are used to create list items, and <ul> element is used to create unordered list items.

The syntax for an unordered list is:

<ul>
    <li>Apple</li>
    <li>Mango</li>
    <li>Orange</li>
</ul>

HTML Unordered List Example

Here is a basic example to create an unordered list.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Unordered Lists</title>
</head>

<body>
    <h2>HTML Unordered Lists</h2>
    
    <ul>
        <li>Apple</li>
        <li>Mango</li>
        <li>Orange</li>
        <li>Banana</li>
        <li>Grapes</li>
    </ul>
</body>

</html>

Output

HTML Unordered List

HTML Unordered List Styles

Attribute ValueDescriptions
discDefault. It creates disc bullet points.
circleIt creates circular bullet points.
squareIt creates square bullet points.
noneIt removes the bullet points.

Example 1: Create a bullet point with a circle list marker.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Unordered Lists</title>
</head>

<body>
    <h2>HTML Unordered Lists (Circle List Marker)</h2>

    <ul style="list-style-type: circle;">
        <li>Apple</li>
        <li>Mango</li>
        <li>Orange</li>
        <li>Banana</li>
        <li>Grapes</li>
    </ul>
</body>

</html>

Output

HTML Unordered Lists (Circle List Marker)

Example 2: Create a bullet point with a square list marker.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Unordered Lists</title>
</head>

<body>
    <h2>HTML Unordered Lists (Square List Marker)</h2>

    <ul style="list-style-type: square;">
        <li>Apple</li>
        <li>Mango</li>
        <li>Orange</li>
        <li>Banana</li>
        <li>Grapes</li>
    </ul>
</body>

</html>

Output

HTML Unordered Lists (Square List Marker)

Example 3: Create an unordered list without bullet points.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Unordered Lists</title>
</head>

<body>
    <h2>HTML Unordered Lists (Without Bullet Points)</h2>

    <ul style="list-style-type: none;">
        <li>Apple</li>
        <li>Mango</li>
        <li>Orange</li>
        <li>Banana</li>
        <li>Grapes</li>
    </ul>
</body>

</html>

Output

HTML Unordered Lists (Without Bullet Points)

Example 4: Creating a nested unordered list.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Unordered Lists</title>
</head>

<body>
    <h2>HTML Unordered Lists (Nested)</h2>

    <ul>
        <li>Fruits
            <ul>
                <li>Apple</li>
                <li>Mango</li>
                <li>Orange</li>
                <li>Banana</li>
                <li>Grapes</li>
            </ul>
        </li>
        <li>Sweets</li>
        <li>Vegitables</li>
    </ul>
</body>

</html>

Output

HTML Unordered Lists (Nested)

Example 5: Creating a horizontal unordered list with CSS (Navigation Bar).

<!DOCTYPE html>
<html lang="en">

<head>
    <title>HTML Horizontal Unordered Lists</title>
    <style>
        ul {
            padding: 0;
            margin: 0;
            list-style-type: none;
            background-color: #2b80ff;
            overflow: hidden;
        }

        li {
            float: left;
        }

        li a {
            text-decoration: none;
            color: white;
            display: block;
            padding: 5px 15px;
        }

        li a:hover {
            background-color: #95befc;
        }
    </style>
</head>

<body>
    <h2>HTML Horizontal Unordered Lists</h2>

    <ul>
        <li><a href="#">Apple</a></li>
        <li><a href="#">Mango</a></li>
        <li><a href="#">Orange</a></li>
        <li><a href="#">Banana</a></li>
        <li><a href="#">Grapes</a></li>
    </ul>
</body>

</html>

Output

Horizontal Unordered List with CSS
HTML, Web Technologies Tags:HTML-Tutorial

Post navigation

Previous Post: JavaScript Program to Print Hello World | First JavaScript Code
Next Post: HTML Ordered Lists

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • June 2025
  • May 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024

Categories

  • CSS
  • HTML
  • JavaScript
  • Lodash
  • PHP
  • Python
  • Web Technologies
  • Web Templates

Recent Posts

  • JavaScript Array isArray() Method
  • JavaScript Array forEach() Method
  • JavaScript Array includes() Method
  • JavaScript Array keys() Method
  • JavaScript Array lastIndexOf() Method

Recent Comments

No comments to show.

Copyright © 2025 WebDevHubs.

Powered by PressBook Green WordPress theme