Lists

Lists can be used in countless ways both for layout purposes and within content areas.

On this page

Standard lists

Standard ordered (<ol>) and unordered (<ul>) lists can be added to article content using the Zendesk article editor.

<ul>
  <li>Lorem ipsum dolor sit amet, adipiscing elit.</li>
  <li>Nulla vitae elit libero, a pharetra augue.
    <ul>
      <li>Donec id elit non mi porta gravida at eget metus.</li>
      <li>Quisque fringilla elit quis purus consectetur.</li>
    </ul>
  </li>
</ul>

Within article content, and any other element with the .content class, each list item has extra space above and below it (set by margin: var(--margin-list-item);) to make long lists easier to read.

Our margin utilities can also be used to control the spacing between list items.

Definition lists

Use <dl> to wrap one or more combinations of <dt> and <dd> elements to create a description list.

<dl>
  <dt>Description term</dt>
  <dd>Description element</dd>
</dl>

Custom styles

Unstyled list

Use .list-unstyled to remove the default styling from <ol> and <ul> elements.

<ul class="list-unstyled">
  <li>List item</li>
  <li>List item</li>
  <li>List item</li>
</ul>

Our list style utilities provide additional control over the look-and-feel of lists.

Bordered list

Use .list-bordered with .list-unstyled to add a border between list items. Our themes use it for lists of articles and other links, and it’s a good replacement for the list groups found in earlier versions of our themes.

<ul class="list-unstyled list-bordered">
  <li class="py-3"><a href="#">How do I reset my password?</a></li>
  <li class="py-3"><a href="#">Changing your email address</a></li>
  <li class="py-3"><a href="#">Closing your account</a></li>
</ul>

For a list of links with a highlighted active item, like the filters on the search results page, use a vertical nav with the active link highlighted using background color utilities:

<nav class="nav flex-column">
  <a class="nav-link border-radius bg-brand text-brand-inverse" href="#" aria-current="page">All results</a>
  <a class="nav-link border-radius" href="#">Articles</a>
  <a class="nav-link border-radius" href="#">Community</a>
</nav>

Numbered list

Use .list-number to apply a custom numbered style to a list.

<ol class="list-number">
  <li>List item</li>
  <li>List item</li>
  <li>List item</li>
</ol>

Check list

Use .list-check to apply a custom checklist style to a list.

<ul class="list-check">
  <li>List item</li>
  <li>List item</li>
  <li>List item</li>
</ul>

Divider list

Use .list-divider to present list items in a horizontal list separated by a divider.

<ul class="list-divider">
  <li>List item</li>
  <li>List item</li>
  <li>List item</li>
</ul>

The divider is set by the --content-list-divider CSS variable (· by default). The data-divider attribute allows you to override the divider applied before a given list item:

<ul class="list-divider">
  <li>List item</li>
  <li data-divider=">">List item</li>
  <li data-divider="/">List item</li>
</ul>

Questions or feedback about this article? Let us know