Markdown Headings | Tutorial
Tutorial -- Learning More Than Just Technology, But Dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
Markdown Tutorial
Markdown Tutorial Markdown Editor Markdown First File Markdown Headings Markdown Text Formatting Markdown Lists Markdown Blockquotes Markdown Code Markdown Links Markdown Images Markdown Tables Markdown Advanced Markdown Dividing Line Markdown Math Formulas Markdown Diagrams Markdown Practices Markdown Quiz Obsidian Usage Tutorial
Markdown Headings
There are two formats for Markdown headings.
1. Using = and - to Mark Level 1 and Level 2 Headings
The syntax for = and - is as follows:
I am showing a level 1 heading=================I am showing a level 2 heading-----------------
The display effect is shown in the image below:
Using # to Mark Headings
Markdown uses the # symbol to create headings, which evolved from the concept of HTML's <h1> to <h6> tags.
Using # can represent levels 1-6 headings. A level 1 heading corresponds to one #, a level 2 heading corresponds to two #s, and so on.
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 Heading
The display effect is shown in the image below:
- Space between symbol and text: There must be a space between the
#symbol and the heading text. This is a standard Markdown syntax requirement.
# Correct
# Incorrect
- Position at the beginning of the line: The
#symbol must be at the beginning of the line, with no other characters (spaces or tabs) before it. - Single Level 1 Heading: In a document, typically only one level 1 heading is used as the main title, which conforms to good document structure practices.
Nested Structure of Headings
The hierarchy of headings should follow a logical order and should not skip levels. A good heading structure is like a book's table of contents:
# Topic: Introduction to Artificial Intelligence
## Part 1: Basic Concepts
### What is Artificial Intelligence
### History of Development
#### Early Development (1950-1980)
#### Modern Development (1980-Present)
## Part 2: Application Areas
### Natural Language Processing
### Computer Vision
### Machine Learning
#### Supervised Learning
#### Unsupervised Learning
#### Reinforcement Learning
# Main Title
### Skipping directly to Level 3 Heading (Not Recommended)
## Then Level 2 Heading
Best Practices for Heading Numbering
Automatic Numbering vs. Manual Numbering:
Many Markdown processors and editors support automatic generation of heading numbers, so manual numbering is usually not needed in the source code:
# Introduction
## Background
## Objectives
# Methodology
## Data Collection
## Analysis Methods
Heading Anchors:
Most Markdown processors automatically create anchors for headings, facilitating in-page navigation:
(#methodology)
Heading Length Recommendations:
- Keep headings concise and clear, generally no more than 10 Chinese characters or 20 English characters.
- Use descriptive words, avoid vague headings like "Other" or "Miscellaneous".
- Colons can be used to separate main topics from subtopics.
YouTip