HTML <ul> Tag

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 3 Examples
HTML5 Standard

What You’ll Learn

The <ul> tag structures unordered lists on webpages. This guide covers syntax, bullet styling, nested lists, common use cases, and how ul differs from ol.

01

Unordered Lists

Bullet-point collections without sequence.

02

li Items

Each entry inside list items.

03

Bullet Styles

disc, circle, square with CSS.

04

Nesting Lists

Hierarchical sub-lists.

05

ul vs ol

Unordered vs ordered lists.

06

CSS Styling

Customize markers with list-style.

What Is the <ul> Tag?

The <ul> tag is an HTML element used to create unordered lists, where the order of items does not matter. Browsers typically display each list item with a bullet point marker.

Valid HTML5 — Use With <li>

Every item in an unordered list must be wrapped in an <li> element. Use ul for feature lists, navigation menus, and any collection where sequence is not important.

📝 Syntax

Wrap each list item in <li> tags inside the opening and closing <ul> tags:

syntax.html
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

Syntax Rules

  • ul is the container; only li (and script-supporting elements) should be direct children.
  • Nested lists go inside an li, not directly under ul.
  • Default bullet style is a filled disc.
  • Style markers with CSS list-style-type instead of the obsolete type attribute.

⚡ Quick Reference

TopicCode SnippetNotes
Basic ul<ul><li>...</li></ul>Default disc bullets
Circle bulletslist-style-type: circle;Open circle marker
Square bulletslist-style-type: square;Square marker
No bulletslist-style: none;Common for nav menus
Nested list<ul><li>...<ul>...</ul></li></ul>Sub-list inside li
Child element<li>Required for each item

⚖️ <ul> vs <ol>

ElementMarkerWhen to Use
<ul>Bullets (disc, circle, square)Unordered collections, features, nav
<ol>Numbers, letters, RomanSteps, rankings, sequences
<li>Child of bothIndividual list item

ul (unordered)

  • Feature A
  • Feature B
  • Feature C

ol (ordered)

  1. Step one
  2. Step two
  3. Step three

🎨 CSS Bullet Styling

Use CSS instead of the obsolete type attribute to control bullet appearance:

list-styles.css
ul.disc   { list-style-type: disc; }
ul.circle { list-style-type: circle; }
ul.square { list-style-type: square; }
ul.none   { list-style: none; padding-left: 0; }

disc (default)

  • Item
  • Item

circle

  • Item
  • Item

square

  • Item
  • Item

🧰 Attributes

The <ul> tag has no required tag-specific attributes in HTML5. The legacy type attribute (disc, circle, square) is obsolete—use CSS instead:

attributes.html
<!-- Legacy (obsolete) -->
<ul type="circle">
  <li>Item A</li>
  <li>Item B</li>
</ul>

<!-- Modern CSS approach -->
<ul class="circle-bullets">
  <li>Item A</li>
  <li>Item B</li>
</ul>
class / id Global

Hook CSS selectors for custom bullet styles and layout.

class="nav-list"
type Obsolete

Legacy values: disc, circle, square. Use CSS list-style-type instead.

list-style-type: circle;

For new projects, CSS list-style-type is preferred over the obsolete type attribute, keeping HTML semantic and presentation in stylesheets.

🧩 Nesting Lists

Nest unordered lists within each other to create a hierarchical structure. Place the nested ul inside a parent li:

nesting-lists.html
<ul>
  <li>Fruits
    <ul>
      <li>Apple</li>
      <li>Orange</li>
    </ul>
  </li>
  <li>Vegetables
    <ul>
      <li>Carrot</li>
      <li>Broccoli</li>
    </ul>
  </li>
</ul>
  • Fruits
    • Apple
    • Orange
  • Vegetables
    • Carrot
    • Broccoli

Examples Gallery

Real-world unordered lists for features, categories, and grouped content.

👀 Live Preview

Default unordered list with disc bullets:

  • Item 1
  • Item 2
  • Item 3

📚 Common Use Cases

Use <ul> for content where order does not matter—feature lists, ingredient groups, navigation links, and categorized items.

Circle Bullet Style

Display open-circle bullets using the legacy type attribute or modern CSS.

circle-bullets.html
<ul type="circle">
  <li>Item A</li>
  <li>Item B</li>
  <li>Item C</li>
</ul>
Try It Yourself

Basic Unordered List

The simplest form: a bullet list of related items such as fruits or features.

basic-unordered-list.html
<ul>
  <li>Apple</li>
  <li>Orange</li>
  <li>Banana</li>
</ul>
Try It Yourself

Nested Lists

Group related items under categories with sub-lists for a more organized structure.

nested-lists.html
<ul>
  <li>Fruits
    <ul>
      <li>Apple</li>
      <li>Orange</li>
      <li>Banana</li>
    </ul>
  </li>
  <li>Vegetables
    <ul>
      <li>Carrot</li>
      <li>Broccoli</li>
      <li>Spinach</li>
    </ul>
  </li>
</ul>
Try It Yourself

♿ Accessibility

  • Semantic lists — Screen readers announce list length and item position automatically.
  • Use ul for unordered content — Do not fake bullets with manual characters or br tags.
  • Meaningful items — Each li should be a complete, understandable point.
  • Nest correctly — Sub-lists inside li preserve logical hierarchy for assistive tech.
  • Nav lists — Wrap navigation links in ul with list-style: none for accessible menus.

🧠 How <ul> Works

1

Author creates ul

Open an unordered list container and add li children.

Markup
2

Browser assigns bullets

Disc, circle, or square markers appear based on CSS list-style-type.

Rendering
3

User scans items

Bullets group related points without implying a required order.

UX
=

Organized, scannable content

Readers browse grouped items without sequence confusion.

Browser Support

The <ul> tag is supported in all major browsers including Internet Explorer. No polyfills are needed.

Baseline · Since HTML 2

Universal unordered list support

Every browser renders <ul> and <li> with bullet markers. CSS list-style properties work in all modern browsers.

100% Core tag support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer Fully supported · EOL
Full support
Opera Fully supported
Full support
<ul> tag 100% supported

Bottom line: Use <ul> confidently for unordered content in any browser.

Conclusion

The HTML <ul> tag is a fundamental building block for organizing content on the web. Whether you are creating a simple feature list or a complex nested structure, mastering ul with li empowers you to craft well-structured, accessible pages.

💡 Best Practices

✅ Do

  • Use semantic HTML with ul and li
  • Style bullets with CSS list-style-type
  • Indent nested lists consistently
  • Use ul when item order does not matter
  • Keep each li concise and meaningful

❌ Don’t

  • Use ul for numbered step sequences
  • Put nested ul directly under ul (skip li)
  • Fake bullets with dashes or asterisks in paragraphs
  • Rely on the obsolete type attribute
  • Skip li wrappers around list content

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about <ul>

Bookmark these before you build your next list.

5
Core concepts
02

Always Use li

Every list entry must be wrapped in <li>.

Essential
🎨 03

CSS Bullets

Style markers with list-style-type, not obsolete type.

Styling
04

ul vs ol

Bullets for unordered; numbers for sequences.

Comparison
🧩 05

Nest Inside li

Sub-lists belong inside a parent li element.

Structure

❓ Frequently Asked Questions

The <ul> element creates an unordered list where item order does not matter. Browsers display bullet markers for each li inside the list.
ul uses bullet points for unordered collections. ol uses numbers or letters for ordered sequences.
Yes. Place a nested ul or ol inside an li element to create hierarchical sub-lists.
Use CSS list-style-type with values like disc, circle, square, or none. Avoid the obsolete type attribute.
Yes. Each entry must be wrapped in an li element. Direct text as children of ul is invalid HTML.
Yes. The ul element is fully supported in all modern browsers and Internet Explorer.

Build your first bullet list

Practice <ul> and <li> markup in the Try It editor.

Try basic list →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful