Start Coding

Markdown Horizontal Rules

Horizontal rules in Markdown provide a simple way to create visual separators between sections of your document. These lines help organize content and improve readability.

Syntax

Markdown offers multiple ways to create horizontal rules. Each method requires a line containing three or more characters:

---
***
___

Any of these three options will produce a horizontal line in your rendered document.

Usage and Best Practices

  • Use horizontal rules sparingly to avoid cluttering your document.
  • Ensure there's a blank line before and after the horizontal rule for proper rendering.
  • Choose one style and use it consistently throughout your document.

Examples

Here are two examples demonstrating the use of horizontal rules in Markdown:

Example 1: Separating Sections

# Introduction
This is the introduction to my document.

---

## Main Content
Here's the main content of the document.

Example 2: Creating a Footer

This is the end of the main content.

***

*Footer information goes here*
© 2023 Your Name

Considerations

While horizontal rules are useful for structuring content, they're just one of many Basic Markdown Syntax elements. Consider using other formatting options like Markdown Headings or Markdown Blockquotes to create visual hierarchy in your documents.

Horizontal rules can be particularly effective when used in conjunction with Markdown for Documentation or Markdown for Blogging, helping to delineate different sections or topics within your content.

Compatibility

Most Markdown flavors support horizontal rules, including GitHub Flavored Markdown (GFM) and CommonMark. However, it's always a good idea to check the specific syntax requirements of your chosen Markdown implementation or platform.

By mastering the use of horizontal rules, you'll enhance the structure and readability of your Markdown documents, making them more accessible to your readers.