Horizontal Rules and Blockquotes in Markdown
Your Markdown documents may often need quotes or separations between sections. Markdown provides simple syntax for blockquotes and horizontal rules to help organize and enhance your content.
Horizontal Rules
Horizontal rules (also called horizontal lines or thematic breaks) are used to visually separate sections of content. If you have used HTML, you may have came across the <hr> element for this purpose. You can create them using three or more hyphens (dashes) (-), asterisks (*), or underscores (_) on a line by themselves.
Using hyphens
Syntax:
---
Result:
Using asterisks
Syntax:
***
Result:
Using underscores
Syntax:
___
Result:
Spacing with horizontal rules
For improved compatibility and readability, it's a good practice to add blank lines before and after horizontal rules:
Text content.
---
More text content after the horizontal rule.
Blockquotes
Blockquotes are used to highlight a section of text is quoted from a different source. They are created by adding a greater-than sign (>) at the beginning of a line.
Basic blockquote
Syntax:
> Be yourself; everyone else is already taken.
Result:
Be yourself; everyone else is already taken.
The appearance of a blockquote can vary depending on any styling rules applied.
Lazy blockquotes
You only need to add the > symbol at the beginning of the first line of each paragraph:
Syntax:
> Be yourself; everyone else is already taken.
The symbol only needs to be on the first line.
> Be mindful. Be grateful. Be positive. Be true. Be kind.
Result:
Be yourself; everyone else is already taken. The symbol only needs to be on the first line.
Be mindful. Be grateful. Be positive. Be true. Be kind.
Nested blockquotes
Nested blockquotes can be created by adding additional > symbols:
Syntax:
> Blockquote first level.
>
> > Nested blockquote.
>
> First level continued.
Result:
Blockquote first level.
Nested blockquote.
First level continued.
Blockquotes with other elements
Blockquotes can contain other Markdown elements, examples include headings, lists, and code blocks:
Syntax:
> ## Blockquote Heading
>
> - Blockquote list item 1
> - Blockquote list item 2
>
> ```
> Code block inside a blockquote
> ```
Result:
Blockquote Heading
- Blockquote list item 1
- Blockquote list item 2
Code block inside a blockquote