InterviewSolution
| 1. |
Lists |
|
Answer» There are 2 types of lists we can add in markdown, 1. Ordered Lists:
2. Element 2 3. Element 3 Output:
1. Level 2 - Level 3 - Level 4 2. Level 1 1. Level 2 3. Level 1 1. Level 2 Output:
2. Unordered Lists: We can create unordered lists with an asterisk(*), (+), or (-) signs as shown below:
* Element 2 * Element 3 Output:
+ Element 2 + Element 3 Output:
- Element 2 - Element 3 Output:
3. Nested Unordered Lists: Unordered Lists can also be nested into multiple sublists beneath them similar to ordered lists. The example below shows how to implement nested unordered lists in markdown. Syntax: - Level 1- Level 2 - Level 3 - Level 4 - Level 1 - Level 2 - Level 1 - Level 2 Output:
We can create lists in the following way by using the HTML tags as shown below:
<li>First item</li> <li>Second item</li> <li>Third item</li> <li>Fourth item</li> </ol> Output:
<li>First item</li> <li>Second item</li> <li>Third item</li> <li>Fourth item</li> </ul> Output:
We can also create task lists in markdown using a hyphen(-) followed by [ ] braces. An x is put inside the braces to indicate the task is complete. Example: - [x] Buy Eggs.- [ ] Buy Milk. - [ ] Wash Clothes. Buy Eggs Buy Milk Buy Books |
|