This article covers all the fundamental Markdown syntax you need to write rich, well-structured content. Every feature includes a working example so you can see exactly how it renders.
Headings
Markdown supports six levels of headings. Use # symbols to define the heading level.
Heading Level 1
Heading Level 2
Heading Level 3
Heading Level 4
Heading Level 5
Heading Level 6
Each heading creates an anchor link automatically, making it easy to share and link directly to specific sections. For accessibility, avoid skipping heading levels — go from h2 to h3, not from h2 to h5.
Text Formatting
Markdown provides several inline formatting options:
| Syntax | Result |
|---|---|
**bold text** | bold text |
*italic text* | italic text |
~~strikethrough~~ | |
**_bold and italic_** | bold and italic |
`inline code` | inline code |
<mark>highlighted</mark> | highlighted |
<sup>superscript</sup> | x2 |
<sub>subscript</sub> | H2O |
You can combine these freely:
- This is bold and italic mixed in a sentence.
- This text has
a deleted partand a replacement. - Use
inline codeinside bold context: theconfig.tsfile.
Lists
Unordered Lists
Use -, *, or + to create unordered lists:
- First item
- Second item
- Third item
- Nested item A
- Nested item B
- Deeply nested item
- Another deeply nested item
- Nested item C
- Fourth item
Ordered Lists
Use numbers followed by a period:
- First step
- Second step
- Third step
- Sub-step 3a
- Sub-step 3b
- Sub-sub-step
- Another sub-sub-step
- Sub-step 3c
- Fourth step
Mixed Lists
You can nest ordered lists inside unordered lists and vice versa:
- Project setup
- Initialize repository
- Install dependencies
- Configure environment
- Development
- Create components
- Write tests
- Review code
- Deployment
- Build project
- Run tests
- Deploy to production
List with Paragraphs
List items can contain multiple paragraphs by indenting:
-
First item with a long description.
This is a continuation paragraph under the first item. Notice the blank line and indentation.
-
Second item.
Another paragraph here. Lists can contain any block-level content when properly indented.
Links and Images
Inline Links
Visit Astro’s official site to learn more about the framework.
You can also add a title attribute: Astro Documentation.
Reference-Style Links
For cleaner text, use reference-style links:
Read the Astro guide or check the Tailwind docs for styling.
Auto-linked URLs
Simply paste a URL and it becomes clickable: https://github.com
Images
Standard image syntax:
Image with title text:
Linked Images
Blockquotes
Simple Blockquote
Markdown is a lightweight markup language with plain text formatting syntax. It was created by John Gruber in 2004.
Multi-Paragraph Blockquote
The first paragraph of the quote.
The second paragraph of the quote. Use a
>on the blank line between paragraphs to keep them in the same blockquote.
Nested Blockquotes
This is the outer blockquote.
This is a nested blockquote. It goes one level deeper.
And this is nested even further — three levels deep!
Back to the first level.
Blockquote with Other Elements
Blockquote with a Heading
- Item one
- Item two
The quote can contain bold, italic, and
codeformatting, as well as lists and other Markdown elements.
Horizontal Rules
You can create horizontal rules with three or more hyphens, asterisks, or underscores:
All three render identically. Use them to visually separate sections of content.
Tables
Simple Table
| Name | Role | Location |
|---|---|---|
| Alice | Frontend Developer | Tokyo |
| Bob | Backend Developer | Berlin |
| Carol | DevOps Engineer | New York |
Aligned Table
Use colons to align columns:
| Left Aligned | Center Aligned | Right Aligned |
|---|---|---|
| Content | Content | Content |
| More | More | More |
| Text | Text | Text |
Complex Table
| Feature | Free Plan | Pro Plan | Enterprise |
|---|---|---|---|
| Users | 1 | 10 | Unlimited |
| Storage | 1 GB | 100 GB | 1 TB |
| API Calls | 1,000/mo | 100,000/mo | Unlimited |
| Support | Community | 24/7 Phone | |
| SSO | ❌ | ❌ | ✅ |
| Custom Domain | ❌ | ✅ | ✅ |
| Analytics | Basic | Advanced | Advanced |
Table with Formatting
| Method | Description | Example |
|---|---|---|
GET | Retrieve a resource | fetch('/api/users') |
POST | Create a new resource | fetch('/api/users', { method: 'POST' }) |
PUT | Update a resource | fetch('/api/users/1', { method: 'PUT' }) |
DELETE | Remove a resource | fetch('/api/users/1', { method: 'DELETE' }) |
Task Lists
Task lists (checkboxes) are great for tracking progress:
- Set up Astro project
- Configure Tailwind CSS
- Create blog layout
- Add search functionality
- Implement dark mode toggle
- Write documentation
Nested Task Lists
- Phase 1: Foundation
- Project scaffolding
- Design system setup
- Base components
- Phase 2: Features
- Blog post rendering
- Tag filtering
- Pagination
- Phase 3: Polish
- Performance optimization
- Accessibility audit
- Cross-browser testing
Footnotes
Footnotes let you add references without cluttering the text.
Markdown was created by John Gruber1 and Aaron Swartz2 in 2004. It has since become one of the most popular markup languages for writing content on the web3.
The original Markdown specification1 was intentionally minimal. Many extended syntaxes like GitHub Flavored Markdown (GFM)4 have expanded on the original.
Emoji Support
You can use emoji shortcodes in your Markdown:
- 🚀 Launch day!
- ⭐ Featured content
- :book: Documentation
- 💡 Tip of the day
- ⚠️ Important notice
- ✔️ Task completed
- ❌ Failed test
- ❤️ Community love
- 🎉 Celebration
- 🚧 Work in progress
Emoji in Context
💡 Tip: Use emoji sparingly in technical writing. They work great for status indicators and casual blog posts.
Here’s a quick project status:
| Task | Status |
|---|---|
| Backend API | ✔️ Complete |
| Frontend UI | 🚧 In Progress |
| Documentation | :book: Drafting |
| Testing | ❌ Not Started |
| Deployment | 🚀 Ready |
Wrapping Up
This article covered the core Markdown syntax you’ll use daily. Markdown’s simplicity is its strength — a few symbols transform plain text into rich, structured documents. For more advanced features like math formulas, code highlighting, and alerts, see the Markdown Extended Features article.
#Footnotes
-
John Gruber is a technology blogger and the creator of the Daring Fireball blog. ↩ ↩2
-
Aaron Swartz was a programmer, writer, and internet activist who contributed to the Markdown specification. ↩
-
According to various developer surveys, Markdown is the most commonly used documentation format. ↩
-
GitHub Flavored Markdown (GFM) adds tables, task lists, strikethrough, and autolinks to the original spec. ↩
评论区
文明评论,共建和谐社区