Creating Nested Lists in Markdown
Learn to create nested lists in Markdown syntax in this quick tip.
You can use two types of lists in markdown:
- Ordered list (starts with numbers)
- Unordered list (starts with a bullet point)
And you can also create nested lists with both of them. Nested lists are nothing but the list you create inside a list.
So in this guide, I will be showing how you can create a nested list in Markdown.
How to create nested lists in Markdown
To create a nested list, first, you should know how to create a normal list.
To create an ordered list, all you have to do is to:
- Type a number from where you have to start the list
- Append the full stop
.
to that number and hit the space bar.
And it will start the ordered list and it should look like this:
- Ordered list item 1
- Ordered list item 2
- Ordered list item 3
Whereas to create an unordered list, you can use *
, -
or +
and other steps should remain the same:
- Unordered list item 1
- Unordered list item 2
- Unordered list item 3
Now, let's have a look at how you can create a nested list
How to create an ordered nested list
To create a nested list, you will have to follow the given simple steps:
- Add a new line where you want to create a nested list
- Add 4 spaces at the beginning of the line and start the list
Yep, that's it.
In the above image, the right portion is the final result.
Sure you can go with nested of nested by adding 8 spaces and to go even further, you have to add 12 spaces:
How to create unordered nested list in Markdown
With a slight change in the above steps, you can create the nested unordered list.
- Add a new line where you want to start an unordered list
- Add 4 space strokes at the beginning of the line and start the unordered list using
*
or any preferred character.
How to create mix nested list in Markdown
Yes, you get best of the both worlds.
The process remains the same. Markdown allows you to start any nested list at any moment.
For example, here, I have created a numbered nested list inside the unordered list.
Where I have added 4 space strokes in the new line and started the ordered list:
Similarly, you can do the same with the ordered list.
In simple terms, you are allowed to use any type of list at any place.
For your reference, I have made a mixed list:
Looking for a Markdown Editor?
If you are looking for a Markdown editor, we have a list of best editors for you:
If you are not familiar with the basics of Markdown, this detailed guide will help you a great deal.
I hope you will find this quick tip helpful. If you have any queries, let me know in the comments.