Using horizontal rules consistently makes Markdown documents easier to read and navigate. Follow these best practices when adding section dividers.
Use Horizontal Rules Only Between Major Sections
Horizontal rules are intended to separate large sections of content rather than individual paragraphs.
Good example:
# Installation
Installation instructions...
---
# Usage
Usage examples...
Avoid inserting a divider after every paragraph, as it can make the page feel cluttered.
Choose One Style
Markdown supports three valid syntaxes:
---
***
___
Although all three produce the same result, it's best to choose one style and use it consistently throughout your documentation.
For most projects, three hyphens (---) are the recommended choice.
Leave Blank Lines Around Horizontal Rules
For better compatibility, leave one blank line before and after each horizontal rule.
Good example:
First section.
---
Second section.
This improves readability and ensures consistent rendering across Markdown editors.
Don't Replace Headings with Horizontal Rules
Horizontal rules separate contentβthey do not replace headings.
Instead of writing:
Introduction
---
Installation
Use proper headings:
# Introduction
Content...
---
# Installation
Content...
This creates a better document structure and improves accessibility.
Preview Before Publishing
Always preview your Markdown document to verify that horizontal rules render correctly.
Most editors, including GitHub, VS Code, Obsidian, and Markdown preview tools, display horizontal rules consistently. Preview in the Markdown Editor before publishing.