Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Creating bulleted lists

To create a bulleted list, you need to add the <ul> and the </ul> tag at the beginning and the end of the list.

You then use the <li> and </li> tags to add the items in the list. For example:

This HTML…

Displays as…

<ul>
<li>Bulleted Lists</li>
<li>Ordered Lists</li>
<li>Directory Lists</li>
<li>Definition Lists</li>
</ul>

  • Bulleted Lists
  • Ordered Lists
  • Directory Lists
  • Definition Lists

To set the style for the bullet, use the type attribute in the <ul> tag. You can choose to display the bullet as a disc, a circle or a square. To change the bullet for items in a list, add the type attribute to the <li> tag. For example:

This HTML…

Displays as…

<ul>
<li type="circle">Bulleted Lists</li>
<li type="disc">Ordered Lists</li>
<li type="square">Directory Lists</li>
</ul>

Once you change the bullet for an item, subsequent items use the same bullet until you change it again.

If you nest bulleted lists; the bullets change as you move through the indent levels from a solid disc, to a circle to a square. For example:

This HTML…

Displays as…

<ul>
<li>A first level item</li>
<ul>
<li>A second level item</li>
<li>Another second level item</li>
</ul>
<li>Another first level item</li>
</ul>

You must always finish the list with the </ul> tag but you can miss off the </li> tag.

  • Note: You can use the <ul> tag to indent paragraphs.

For example:

<ul>This paragraph will be indented one level.</ul>