Quick Reference to Markdown Syntax

Markdown

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:

  1. Ordered list (starts with numbers)
  2. 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:

  1. Ordered list item 1
  2. Ordered list item 2
  3. 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:

  1. Add a new line where you want to create a nested list
  2. 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:

create nested of nested list in markdown

How to create unordered nested list in Markdown

With a slight change in the above steps, you can create the nested unordered list.

  1. Add a new line where you want to start an unordered list
  2. Add 4 space strokes at the beginning of the line and start the unordered list using * or any preferred character.
Create unordered nested list in markdown

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:

mixed nested list in markdown

Looking for a Markdown Editor?

If you are looking for a Markdown editor, we have a list of best editors for you:

11 Best Markdown Editors for Linux
Markdown is a simple markup language. It’s lightweight and easy to learn. If you haven’t seen any markdown document yet, just head over to GitHub and enter any open-source project. The README file almost certainly will be written using Markdown. Basically, you use some ‘code’ before your text

If you are not familiar with the basics of Markdown, this detailed guide will help you a great deal.

Basic Markdown Syntax Explained [With Free Cheat Sheet]
Learning markdown could help you a lot with writing for web. Here’s a complete beginner’s guide to Markdown syntax with downloadable cheat sheet.

I hope you will find this quick tip helpful. If you have any queries, let me know in the comments.