How to create a horizontal line in Markdown?

Published on Aug. 22, 2023, 12:17 p.m.

To create a horizontal line in Markdown, you can use three or more asterisks, hyphens, or underscores on a line by themselves. Here are a few examples:

***
---
___

All three of these will create a horizontal line. When rendered, the line will extend across the entire width of the container. Some Markdown editors and viewers may also render different styles of horizontal lines, such as double or dotted lines.

Note that you should have a blank line before and after the horizontal line, otherwise Markdown may interpret it as a heading or a list item.

Some content

---

More content

This would result in a horizontal line separating the two paragraphs of content.

Keep in mind that the number of asterisks, hyphens, or underscores doesn’t matter, as long as there are at least three of them on a line by itself.

Tags: