Markdown 标题语法
要创建标题,请在单词或短语前面添加井号 (#
) 。#
的数量代表了标题的级别。例如,添加三个 #
表示创建一个三级标题 (<h3>
) (例如:### My Header
)。
Markdown语法 | HTML | 预览效果 |
---|
Heading level 1 |
Heading level 1
| Heading level 1Heading level 2 |
Heading level 2
| Heading level 2Heading level 3 |
Heading level 3
| Heading level 3Heading level 4 |
Heading level 4
| Heading level 4Heading level 5 |
Heading level 5
| Heading level 5Heading level 6 |
Heading level 6
| Heading level 6Markdown 引用语法
要创建块引用,请在段落前添加一个 >
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
渲染效果如下所示:
Dorothy followed her through many of the beautiful rooms in her castle.
#多个段落的块引用
块引用可以包含多个段落。为段落之间的空白行添加一个 >
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
渲染效果如下:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
#嵌套块引用
块引用可以嵌套。在要嵌套的段落前添加一个 >>
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
渲染效果如下:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
#带有其它元素的块引用
块引用可以包含其他 Markdown 格式的元素。并非所有元素都可以使用,你需要进行实验以查看哪些元素有效。
> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
> *Everything* is going according to **plan**.
渲染效果如下:
The quarterly results look great!
Revenue was off the chart.
Profits were higher than ever.
Everything is going according to plan.
�# Markdown 标题语法
要创建标题,请在单词或短语前面添加井号 (#
) 。#
的数量代表了标题的级别。例如,添加三个 #
表示创建一个三级标题 (<h3>
) (例如:### My Header
)。
Markdown语法 | HTML | 预览效果 |
---|---|---|
# Heading level 1 |
<h1>Heading level 1</h1> |
Heading level 1 |
## Heading level 2 |
<h2>Heading level 2</h2> |
Heading level 2 |
### Heading level 3 |
<h3>Heading level 3</h3> |
Heading level 3 |
#### Heading level 4 |
<h4>Heading level 4</h4> |
Heading level 4 |
##### Heading level 5 |
<h5>Heading level 5</h5> |
Heading level 5 |
###### Heading level 6 |
<h6>Heading level 6</h6> |
Heading level 6 |
Markdown 段落
要创建段落,请使用空白行将一行或多行文本进行分隔。
Markdown语法 | HTML | 预览效果 |
---|---|---|
I really like using Markdown.I think I'll use it to format all of my documents from now on. |
<p>I really like using Markdown.</p><p>I think I'll use it to format all of my documents from now on.</p> |
I really like using Markdown.I think I'll use it to format all of my documents from now on. |
# Markdown 换行语法
在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行(<br>
)。
Markdown语法 | HTML | 预览效果 |
---|---|---|
This is the first line. And this is the second line. |
<p>This is the first line.<br>And this is the second line.</p> |
This is the first line. And this is the second line. |
# Markdown 强调语法
通过将文本设置为粗体或斜体来强调其重要性。
#粗体(Bold)
要加粗文本,请在单词或短语的前后各添加两个星号(asterisks)或下划线(underscores)。如需加粗一个单词或短语的中间部分用以表示强调的话,请在要加粗部分的两侧各添加两个星号(asterisks)。
Markdown语法 | HTML | 预览效果 |
---|---|---|
I just love **bold text**. |
I just love <strong>bold text</strong>. |
I just love bold text. |
I just love __bold text__. |
I just love <strong>bold text</strong>. |
I just love bold text. |
Love**is**bold |
Love<strong>is</strong>bold |
Loveisbold |
Markdown 应用程序在如何处理单词或短语中间的下划线上并不一致。为兼容考虑,在单词或短语中间部分加粗的话,请使用星号(asterisks)。
✅ Do this | ❌ Don't do this |
---|---|
Love**is**bold |
Love__is__bold |
#斜体(Italic)
要用斜体显示文本,请在单词或短语前后添加一个星号(asterisk)或下划线(underscore)。要斜体突出单词的中间部分,请在字母前后各添加一个星号,中间不要带空格。
Markdown语法 | HTML | 预览效果 |
---|---|---|
Italicized text is the *cat's meow*. |
Italicized text is the <em>cat's meow</em>. |
Italicized text is the cat’s meow. |
Italicized text is the _cat's meow_. |
Italicized text is the <em>cat's meow</em>. |
Italicized text is the cat’s meow. |
A*cat*meow |
A<em>cat</em>meow |
Acatmeow |
要同时用粗体和斜体突出显示文本,请在单词或短语的前后各添加三个星号或下划线。要加粗并用斜体显示单词或短语的中间部分,请在要突出显示的部分前后各添加三个星号,中间不要带空格。
✅ Do this | ❌ Don't do this |
---|---|
A*cat*meow |
A_cat_meow |
要同时用粗体和斜体突出显示文本,请在单词或短语的前后各添加三个星号或下划线。要加粗并用斜体显示单词或短语的中间部分,请在要突出显示的部分前后各添加三个星号,中间不要带空格。
Markdown语法 | HTML | 预览效果 |
---|---|---|
This text is ***really important***. |
This text is <strong><em>really important</em></strong>. |
This text is *really important*. |
This text is ___really important___. |
This text is <strong><em>really important</em></strong>. |
This text is *really important*. |
This text is __*really important*__. |
This text is <strong><em>really important</em></strong>. |
This text is *really important*. |
This text is **_really important_**. |
This text is <strong><em>really important</em></strong>. |
This text is *really important*. |
This is really***very***important text. |
This is really<strong><em>very</em></strong>important text. |
This is really***very***important text. |
### #粗体(Bold)和斜体(Italic)用法的最佳实践
Markdown 应用程序在处理单词或短语中间添加的下划线上并不一致。为了实现兼容性,请使用星号将单词或短语的中间部分加粗并以斜体显示,以示重要。
✅ Do this | ❌ Don't do this |
---|---|
This is really***very***important text. |
This is really___very___important text. |
# Markdown 引用语法
要创建块引用,请在段落前添加一个 >
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
渲染效果如下所示:
Dorothy followed her through many of the beautiful rooms in her castle.
#多个段落的块引用
块引用可以包含多个段落。为段落之间的空白行添加一个 >
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
渲染效果如下:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
块引用可以嵌套。在要嵌套的段落前添加一个 >>
符号。
> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
渲染效果如下:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
块引用可以包含其他 Markdown 格式的元素。并非所有元素都可以使用,你需要进行实验以查看哪些元素有效。
> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
> *Everything* is going according to **plan**.
渲染效果如下:
The quarterly results look great!
- Revenue was off the chart.
- Profits were higher than ever.
Everything is going according to plan.