Markdown 基础语法

Markdown 基础语法

Markdown 语法指导
Markdown 基础语法 传送门

BLOCK ELEMENTS

Header1

Header2

Header 3

This is a blockquote.

this is a blockquote in blockquote

This is the second paragraph in the blockquote.

This is an H2 in a blockquote

# Header1
## Header2
### Header 3

> This is a blockquote.
> > this is a blockquote in blockquote

> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote

PHRASE EMPHASIS

Some of these words are emphasized.
Some of these words are emphasized also.

Use two asterisks for strong emphasis.
Or, if you prefer, use two underscores instead.

Some of these words *are emphasized*.
Some of these words _are emphasized also_.

Use two asterisks for **strong emphasis**.
Or, if you prefer, __use two underscores instead__.

LISTS

  • Candy.
  • Gum.
  • Booze.
  • Candy.
  • Gum.
  • Booze.
  • Candy.
  • Gum.
  • Booze.
  • A list item.

    With multiple paragraphs.

  • Another item in the list.

*   Candy.
*   Gum.
*   Booze.
> 
+   Candy.
+   Gum.
+   Booze.
> 
-   Candy.
-   Gum.
-   Booze.
> 
*   A list item.

    With multiple paragraphs.

*   Another item in the list.

This is an example link.
This is an example link.

I get 10 times more traffic from Google than from
Yahoo or MSN.

I start my morning with a cup of coffee and
The New York Times.

This is an [example link](http://example.com/).
This is an [example link](http://example.com/ "With a Title").
> 
I get 10 times more traffic from [Google][1] than from
[Yahoo][2] or [MSN][3].

[1]: http://google.com/        "Google"
[2]: http://search.yahoo.com/  "Yahoo Search"
[3]: http://search.msn.com/    "MSN Search"
> 
I start my morning with a cup of coffee and
[The New York Times][NY Times].

[ny times]: http://www.nytimes.com/

IMAGES

a lot of corgi

a lot of corgi

![a lot of corgi](https://images.cnblogs.com/cnblogs_com/zakun/815346/o_210930085412corgi.gif "corgi")

![a lot of corgi][id]

[id]: https://images.cnblogs.com/cnblogs_com/zakun/815346/o_210930085412corgi.gif "Title"

CODE

In a regular paragraph, you can create code span by wrapping text in backtick quotes. Any ampersands (&) and angle brackets (< or >) will automatically be translated into HTML entities. This makes it easy to use Markdown to write about HTML example code:

I strongly recommend against using any <blink> tags.

I wish SmartyPants used named entities like &mdash;
instead of decimal-encoded entites like &#8212;.

To specify an entire block of pre-formatted code, indent every line of the block by 4 spaces or 1 tab. Just like with code spans, &, <, and > characters will be escaped automatically.

If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:

<blockquote>
    <p>For example.</p>
</blockquote>

Table

Markdown 制作表格使用 | 来分隔不同的单元格,使用 - 来分隔表头和其他行。

语法格式如下:

|  表头   | 表头  |
|  ----  | ----  |
| 单元格  | 单元格 |
| 单元格  | 单元格 |

效果如下:

表头 表头
单元格 单元格
单元格 单元格

对齐方式:

  • -: 设置内容和标题栏居右对齐。
  • :- 设置内容和标题栏居左对齐。
  • :-: 设置内容和标题栏居中对齐。

语法如下:

| 左对齐 | 右对齐 | 居中对齐 |
| :-----| ----: | :----: |
| 单元格 | 单元格 | 单元格 |
| 单元格 | 单元格 | 单元格 |

效果如下:

左对齐 右对齐 居中对齐
单元格 单元格 单元格
单元格 单元格 单元格
posted @ 2021-09-30 17:12  zakun  阅读(81)  评论(0编辑  收藏  举报
返回顶部