Complete Guide to Markdown Bullet Lists and Numbered Lists
By Pete Freitag
Here is a quick guide to creating lists with Markdown. First I'll show you how to create a bullet lists with markdown, also known as ul lists in HTML, or unordered lists. Then I'll show you how to create a markdown numbered list, or an ordered list.
Markdown Bullet List Example
To create a markdown bullet list start the line with either a *
character, the +
or a -
character. It doesn't matter which one you pick,
as long as you start the line with a *
, a +
or a -
character markdown will interpret that as an unordered list item.
The following markdown segment:
* One * Two
Will produce a bullet list that looks like this:
- One
- Two
As already mentioned we can use a -
or +
to start an unordered list in Markdown as well:
- One - Two
All three leading characters will produce the same list as above, but the *
character tends to be the most popular choice.
What about nested bullet lists?
To create a nested UL list just indent the line with a tab or 3-4 spaces. For example the following markdown:
* One * Two * Three * Four
Will render as the following:
- One
- Two
- Three
- Four
- Three
Can you Mix *
+
and -
?
You certainly can, the following will render the same list nested bullet list as above:
* One * Two + Three - Four
Some linters may suggest that you start your nested list with a *
, but any of the three unordered list characters should work just fine.
Markdown Numbered Lists
You can create numbered lists in markdown by prefixing each line with incrementing numbers followed by a period. For example:
1. One 2. Two
The above markdown segment results in the following ordered list. The ordered or numbered markdown list renders in HTML using the OL
tag:
- One
- Two
That's pretty much all I know about markdown lists, did I miss anything?
Complete Guide to Markdown Bullet Lists and Numbered Lists was first published on November 22, 2019.