Markdown 速查表
大约 3 分钟教程
文章地址:
总览
Markdown 速查表提供了所有 Markdown 语法元素的基本解释。如果你想了解某些语法元素的更多信息,请参阅更详细的 基本语法 和 扩展语法.
基本语法
这些是 John Gruber 的原始设计文档中列出的元素。所有 Markdown 应用程序都支持这些元素。
标题(Heading)
粗体(Bold)
点击查看代码
bold text
**bold text**
斜体(Italic)
点击查看代码
italicized text
*italicized text*
引用块(Blockquote)
点击查看代码
blockquote
> blockquote
有序列表(Ordered List)
点击查看代码
- First item
- Second item
- Third item
1. First item
2. Second item
3. Third item
无序列表(Unordered List)
点击查看代码
- First item
- Second item
- Third item
- First item
- Second item
- Third item
代码(Code)
点击查看代码
code
`code`
分隔线(Horizontal Rule)
点击查看代码
---
链接(Link)
图片(Image)
点击查看代码
![alt text](/assets/example-DxhMTyB8.jpg)
![alt text](example.jpg)
扩展语法
这些元素通过添加额外的功能扩展了基本语法。但是,并非所有 Markdown 应用程序都支持这些元素。
表格(Table)
点击查看代码
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
代码块(Fenced Code Block)
点击查看代码
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
脚注(Footnote)
点击查看代码
Here's a sentence with a footnote. [^1] [^1]: This is the footnote.
Here's a sentence with a footnote. [^1]
[^1]: This is the footnote.
标题编号(Heading ID)
定义列表(Definition List)
点击查看代码
term
: definition
term
: definition
删除线(Strikethrough)
点击查看代码
The world is flat.
~~The world is flat.~~
任务列表(Task List)
点击查看代码
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
非正式语法
下划线(Underline)
点击查看代码
Some of these words will be underlined.
Some of these words <ins>will be underlined</ins>.
居中 (Center)
点击查看代码
Center this text
<p style="text-align:center">Center this text</p>
颜色(Color)
点击查看代码
Make this text blue.
<p style="color:blue">Make this text blue.</p>
评论(Comments)
点击查看代码
Here's a paragraph that will be visible.
And here's another paragraph that's visible.
Here's a paragraph that will be visible.
[This is a comment that will be hidden.]: #
And here's another paragraph that's visible.
警告(Admonitions)
点击查看代码
Some of these words will be underlined.
Some of these words <ins>will be underlined</ins>.
图像尺寸(Image Size)
点击查看代码
![](/assets/example-DxhMTyB8.jpg)
<img src="./example.jpg" width="200" height="100">
图片说明(Image Captions)
点击查看代码
![Albuquerque, New Mexico](/assets/example-DxhMTyB8.jpg)
<figure>
<img src="./example.jpg"
alt="Albuquerque, New Mexico">
<figcaption>A single track trail outside of Albuquerque, New Mexico.</figcaption>
</figure>
链接目标(Underline)
符号(Symbols)
点击查看代码
©
©
表格格式(Table Formatting)
点击查看代码
Syntax | Description |
---|---|
Header | Title |
Paragraph | First paragraph. Second paragraph. |
List | Here's a list!
|
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | First paragraph. <br><br> Second paragraph. |
| List | Here's a list! <ul><li>Item one.</li><li>Item two.</li></ul> |
## 目录(## Table of Contents)
点击查看代码
Table of Contents
- [Underline](#underline)
- [Indent](#indent)
- [Center](#center)
- [Color](#color)