Markdown基本語法總結(jié)

Markdown基本語法總結(jié)

Markdown 是一種輕型語法標(biāo)記語言,其語法全部由一些符號(hào)所組成,易讀易寫。這篇文章會(huì)對(duì)markdown的基本語法進(jìn)行介紹。

區(qū)塊元素

標(biāo)題

標(biāo)題用#符號(hào)表示,#的數(shù)量表示決定標(biāo)題的階數(shù)(h1--h6)


###### 這是 h6

##### 這是 h5

#### 這是 h4

這是 h6
這是 h5

這是 h4

引用

區(qū)塊引用使用的是 >??梢栽谝玫拿恳恍星凹由?code>>,也可只在段首添加>。

區(qū)塊引用可以嵌套,也可以使用其他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 支持有序列表和無序列表。

無序列表用*/ + /- 作為標(biāo)記,有序列表用數(shù)字接英文句點(diǎn)作為標(biāo)記。


* Red

* Green

* Blue

  • Red

  • Green

  • Blue


1. Apple

2. Banana

3. Orange

  1. Apple

  2. Banana

  3. Orange

代碼區(qū)塊

縮進(jìn)四個(gè)空格。

分隔線

在一行中使用三個(gè)以上的*/-/_可以建立分隔線,行內(nèi)不能有其他字符。


***

---

________


區(qū)段元素

鏈接

鏈接的建立有以下幾種形式

  1. <http://鏈接地址>,直接顯示鏈接地址。

http://鏈接地址

  1. [鏈接文字](http://鏈接地址),只顯示鏈接文字。

鏈接文字

  1. [鏈接文字][id],只顯示鏈接文字。使用這種方式建立鏈接,需要在文件的任意處,把這個(gè)標(biāo)記的鏈接內(nèi)容定義出來[id]: http://鏈接地址。這種方式可以使文章在編輯時(shí)更簡潔易讀,并且易于管理文章中所引用的所有鏈接。

強(qiáng)調(diào)

加粗: **加粗**

斜體:_斜體_

加粗, 斜體。

代碼標(biāo)記

行內(nèi)代碼使用反撇號(hào)標(biāo)記,多行代碼塊用多個(gè)反撇號(hào)進(jìn)行標(biāo)記。


這是行內(nèi)代碼`code`的使用方法。

這是多行代碼塊的使用方法:

    ```

    Your code here.

    Your code here.

    Your code here.

    Your code here.

    ```

這是行內(nèi)代碼code的使用方法。

代碼塊的使用


            Your code here.

            Your code here.

            Your code here.

圖片

圖片的標(biāo)記方式和鏈接類似。

  1. 行內(nèi)式: [描述文字](圖片路徑)

  2. 參考式: ![描述文字][id]

                `[id](圖片路徑)`
    
描述文字

表格

  1. 第一行為表頭,第二行分隔表頭和表格主題,第三行起每一行為一個(gè)表格行。

  2. 列與列之間用管道符分隔|。


|col 1|col 2|col 3|

|-----|-----|-----|

|abc  | abc | abc |

| def | def | def |

|col 1|col 2|col 3|

|-----|-----|-----|

|abc | abc | abc |

| def | def | def |

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容