Markdown基本语法总结
Markdown 是一种轻型语法标记语言,其语法全部由一些符号所组成,易读易写。这篇文章会对markdown的基本语法进行介绍。
区块元素
标题
标题用#符号表示,#的数量表示决定标题的阶数(h1--h6)
###### 这是 h6
##### 这是 h5
#### 这是 h4
这是 h6
这是 h5
这是 h4
引用
区块引用使用的是 >。可以在引用的每一行前加上>,也可只在段首添加>。
区块引用可以嵌套,也可以使用其他Markdown语法。
> Without factitious support, man is sure to come to earth again beyond that distance. The first question which I am tempted to put to the proprietor of such great impropriety is, Who bolsters you? Are you one of the ninety-seven who fail, or the three who succeed?
>> Most of the luxuries, and many of the so-called comforts of life, are not only not indispensable, but positive hindrances th the elevation of mankind.
Without factitious support, man is sure to come to earth again beyond that distance. The first question which I am tempted to put to the proprietor of such great impropriety is, Who bolsters you? Are you one of the ninety-seven who fail, or the three who succeed?
Most of the luxuries, and many of the so-called comforts of life, are not only not indispensable, but positive hindrances th the elevation of mankind.
列表
Markdown 支持有序列表和无序列表。
无序列表用*/ + /- 作为标记,有序列表用数字接英文句点作为标记。
* Red
* Green
* Blue
-
Red
-
Green
-
Blue
1. Apple
2. Banana
3. Orange
-
Apple
-
Banana
-
Orange
代码区块
缩进四个空格。
分隔线
在一行中使用三个以上的*/-/_可以建立分隔线,行内不能有其他字符。
***
---
________
区段元素
链接
链接的建立有以下几种形式
-
<http://链接地址>,直接显示链接地址。
-
[链接文字](http://链接地址),只显示链接文字。
-
[链接文字][id],只显示链接文字。使用这种方式建立链接,需要在文件的任意处,把这个标记的链接内容定义出来[id]: http://链接地址。这种方式可以使文章在编辑时更简洁易读,并且易于管理文章中所引用的所有链接。
强调
加粗: **加粗**
斜体:_斜体_
加粗, 斜体。
代码标记
行内代码使用反撇号标记,多行代码块用多个反撇号进行标记。
这是行内代码`code`的使用方法。
这是多行代码块的使用方法:
```
Your code here.
Your code here.
Your code here.
Your code here.
```
这是行内代码code的使用方法。
代码块的使用
Your code here.
Your code here.
Your code here.
图片
图片的标记方式和链接类似。
-
行内式:
[描述文字](图片路径) -
参考式:
![描述文字][id]`[id](图片路径)`
描述文字
表格
-
第一行为表头,第二行分隔表头和表格主题,第三行起每一行为一个表格行。
-
列与列之间用管道符分隔
|。
|col 1|col 2|col 3|
|-----|-----|-----|
|abc | abc | abc |
| def | def | def |
|col 1|col 2|col 3|
|-----|-----|-----|
|abc | abc | abc |
| def | def | def |












网友评论