DEV Community

Cover image for Markdown for beginners: with examples
Sachin Chaurasiya
Sachin Chaurasiya

Posted on • Originally published at blog.sachinchaurasiya.dev

Markdown for beginners: with examples

Introduction ✨

Markdown is a lightweight markup language that is used to format text documents. It is designed to be easy to read and write and is often used for formatting text on the web, such as in blog posts and online forums.

In this article, we will go over the basics of Markdown, including some examples of how it can be used to format text.

Examples 👉

The first thing to understand about Markdown is that it uses a simple syntax to format text. This syntax is based on a few basic rules, such as using hashtags (#) to create headings, using asterisks (*) to create bullet points and using dashes (-) to create horizontal lines.

Headings #

For example, to create a heading in Markdown, you would use one or more hashtags followed by a space, like this:

# Heading 1
## Heading 2
### Heading 3
Enter fullscreen mode Exit fullscreen mode

Bullet Points •

To create a bullet point list in Markdown, you would use an asterisk followed by a space before each item, like this:

* Item 1
* Item 2
* Item 3
Enter fullscreen mode Exit fullscreen mode

Horizontal line ⎯

To create a horizontal line in Markdown, you would use three dashes (---) on a separate line, like this:

---
Enter fullscreen mode Exit fullscreen mode

Bold Text 𝐁

Markdown also supports other formatting options, such as bold and italic text, links, and images. To create bold text, you would use two asterisks on either side of the text, like this:

**bold text**
Enter fullscreen mode Exit fullscreen mode

Italic Text 𝑖

To create italic text, you would use one asterisk on either side of the text, like this:

*italic text*
Enter fullscreen mode Exit fullscreen mode

Link 🔗

To create a link, you would use brackets [] to enclose the text to be linked and parenthesis () to enclose the link, like this:

[Google](https://www.google.com)
Enter fullscreen mode Exit fullscreen mode

Image 🌠

To insert an image, you use an exclamation mark followed by the alt text in brackets and the URL of the image in parenthesis

![image alt text](https://www.example.com/image.jpg)
Enter fullscreen mode Exit fullscreen mode

Blockquote ⍘

To create a blockquote, you would use the greater than symbol (>), followed by a space and your quoted text.

> This is a blockquote
Enter fullscreen mode Exit fullscreen mode

Code Block 👨🏻‍💻

To create a code block, you can use backticks () or triple backticks (\\) before and after your code. The triple backticks also allow you to specify the language being used.

`code`
Enter fullscreen mode Exit fullscreen mode
const greeting = () => "Hello Folks✨"
Enter fullscreen mode Exit fullscreen mode

Task List 📝

you can create a task list by using a hyphen (-) followed by a space and a pair of square brackets [], with a space inside. If the task is completed, you can put an "X" inside the square brackets

- [ ] Task 1
- [x] Task 2 (completed)
Enter fullscreen mode Exit fullscreen mode

Table 📰

To create tables, you can use pipes (|) and dashes (-) to separate the columns and rows.

| Column 1 | Column 2 | Column 3 |
| --- | --- | --- |
| Row 1, Column 1 | Row 1, Column 2 | Row 1, Column 3 |
| Row 2, Column 1 | Row 2, Column 2 | Row 2, Column 3 |
Enter fullscreen mode Exit fullscreen mode

Markdown supports many other formatting options as well, but the examples above should give you a good idea of the types of formatting that can be achieved using this language.

Remember that some of the formatting options may not be supported by all platforms and it's a good idea to check the documentation or guidelines of the platform you are using to make sure that your formatting will be properly displayed.

Conclusion ✨

In conclusion, Markdown is a lightweight markup language that can be used to format text in a simple and easy-to-read way. It is based on a few basic rules, such as using hashtags to create headings, asterisks to create bullet points, and dashes to create horizontal lines.

Additionally, it also supports other formatting options such as bold, italic, links, and images. With a little practice, you'll be able to use Markdown to format your text quickly and easily.

And that’s it for this topic. Thank you for reading.

If you found this article useful, please consider liking and sharing it with others. If you have any questions, feel free to comment, and I will do my best to respond.

Resource 💡

Connect with me 👋

Top comments (0)