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

`反单引号(backquote),又称反引号,是西文字符中的附加符号,主要用于计算机领域。位置在键盘中数字键1的左边,在英文输入法状态下用户可以直接通过按此键来输入反引号。

行内代码

At the command prompt, type `vim`.
At the command prompt, type <code>vim</code>.

渲染效果:
At the command prompt, type vim.

转义反引号

如果你要表示为代码的单词或短语中包含一个或多个反引号,则可以通过将单词或短语包裹在双反引号``中。

``Use `code` in your Markdown file.``
<code>Use `code` in your Markdown file.</code>

渲染效果:
Use `code` in your Markdown file.

代码块

要创建代码块,请将代码块的每一行缩进至少四个空格或一个制表符。

    &lt;html>
      &lt;head>
      &lt;/head>
    &lt;/html>

渲染效果如下:

&lt;html>  
  &lt;head>  
  &lt;/head>  
&lt;/html>  

💡 要创建不用缩进的代码块,请使用 围栏式代码法