Skip to main content

How to Make a Bulleted List in HTML

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

A <ul> with one <li> for each item makes a bulleted list: the browser draws a bullet in front of every item and indents the list from the text around it.

Syntax​

Syntax
<ul>
<li><item></li>
<li><item></li>
</ul>
PartWhat it does
<ul>An unordered list, a list whose order doesn't matter. The browser shows it with bullets.
<li>One list item. Add as many as you need.
<item>The item's text.

MDN's ul page describes the list, and the li page its items.

The Example​

The example is a list of things to bring to a picnic: sandwiches, water and a blanket.

Step 1: Write the Code​

Create a file named index.html in a text editor, such as Visual Studio Code:

index.html, an HTML page with the paragraph Bring to the picnic: and a ul element holding three li items, Sandwiches, Water and A blanket.

index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Picnic</title>
</head>
<body>
<p>Bring to the picnic:</p>
<ul>
<li>Sandwiches</li>
<li>Water</li>
<li>A blanket</li>
</ul>
</body>
</html>

Step 2: Open It in a Browser​

Double-click index.html. It opens in your browser:

The page in Chromium: Bring to the picnic: followed by a bulleted list of Sandwiches, Water and A blanket.

The screenshot comes from Chromium 159, the open-source browser that Chrome is built on.

What Happened​

  • Each li got a round bullet. Chromium's default bullet style for a ul is called disc.
  • The list is indented, by 40 pixels of padding on its left side, and has 16 pixels of space above and below it.

Common Mistakes​

MistakeWhat happensDo this instead
Writing the items straight inside ul, without liNo bullets: Sandwiches written straight inside ul showed up as plain indented textPut each item in its own li
Using ul for steps that must happen in orderThe bullets don't show the orderUse ol, which numbers the items

Troubleshooting​

SymptomLikely causeFix
The list has no bulletsThe items aren't in li elementsWrap each item in li
The items are numbered instead of bulletedThe list is an olChange ol to ul

FAQ​

How do I make a numbered list?​

Use ol instead of ul. Chromium numbered the items of an ol 1., 2. and so on, with the list style decimal.

How do I put a list inside a list?​

Put the inner ul inside one of the outer list's li elements. Chromium showed the inner list's bullets as hollow circles, so the two levels look different.

Can a list item hold more than text?​

Yes. An li can hold links, paragraphs or even another list, as the previous answer shows.

Conclusion​

ul makes a bulleted list and li makes each item in it. Keep every item in its own li, nest lists inside an li, and switch to ol when the order matters.

Additional Resources​