banner

Markdown 语法学习 (基本语法)

Scroll down

学习 markdown 语法,官网地址

标题语法

创建标题,可以在 title 前面添加 #。 #的数量代表了标题的级别

Markdown 语法 预览效果 HTML 语法
# level 1 level 1 <h1>level 1</h1>
## level 2 level 2 <h2>level 2</h2>
### level 3 level 3 <h3>level 3</h3>
#### level 4

level 4

<h4>level 4</h4>
##### level 5
level 5
<h5>level 5</h5>
###### level 6
level 6
<h6>level 6</h6>

段落

多个段落之间使用空白行隔开

Markdown 语法 预览效果 HTML 语法

I really like using Markdown.

I think I’ll use it to format all of my documents from now on.

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>

换行语法

在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行(<br>)。

Markdown 语法 预览效果 HTML 语法

This is the first line.
And this is the second line.

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>

强调语法

粗体

可以在内容前后添加两个**xxx** 或者 __xxx__

Markdown 语法 预览效果 HTML 语法
I just love **bold text**. 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>.

斜体

同粗体,但是前后各添加一个* 或者一个_

粗体和斜体

同时实现粗体和斜体 前后各添加三个***或者___

引用语法

本博客已对该样式做了修改,原本样式可参考官网

语法: 在段落前面添加一个 > 符号

1
> Dorothy followed her through many of the beautiful rooms in her castle.

渲染效果

Dorothy followed her through many of the beautiful rooms in her castle.

多个段落的引用

1
2
3
> 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.

嵌套引用

1
2
3
> 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.

带有其他元素块的引用

1
2
3
4
5
6
> #### 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 语法 预览效果 HTML 语法
1. First item
2. Second item
3. Third item
4. Fourth item
1. First item
2. Second item
3. Third item
4. Fourth item
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>

无序列表

本博客已对该样式做了修改,原本样式可参考官网

Markdown 语法 预览效果 HTML 语法
- First item
- Second item
- Third item
- Fourth item

  • First item

  • Second item

  • Third item

  • Fourth item

<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>

代码语法

要将单词或短语表示为代码,将其包裹在反引号 (`) 中。

Markdown 语法 预览效果 HTML 语法|
At the command prompt, type `nano`. At the command prompt, type nano. At the command prompt, type <code>nano</code>.

分割线语法

在单独一行上使用三个或多个星号 (***)、破折号 (—) 或下划线 (___) ,并且不能包含其他内容。

效果预览

Try to put a blank line before…


…and after a horizontal rule.

链接语法

[链接标题](链接地址)。

图片语法

![图片名称](图片地址)

其他文章
目录导航 置顶
  1. 1. 标题语法
  2. 2. 段落
  3. 3. 换行语法
  4. 4. 强调语法
    1. 4.1. 粗体
    2. 4.2. 斜体
    3. 4.3. 粗体和斜体
  5. 5. 引用语法
  6. 6. 列表语法
    1. 6.1. 有序列表
    2. 6.2. 无序列表
  7. 7. 代码语法
  8. 8. 分割线语法
  9. 9. 链接语法
  10. 10. 图片语法
请输入关键词进行搜索