> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/heading.md).

# 标题

标题有助于为你的文档建立结构——在标题中使用关键词也能帮助搜索引擎理解这种结构，从而提升你的页面在搜索结果中的排名。

GitBook 提供三级标题。标题级别 1（H1）和 2（H2）将显示在 [页面大纲](/docs/documentation/zh/can-kao/gitbook-ui.md#page-outline).

### 锚点链接

当你向页面添加标题时，它会创建一个锚点链接。然后你可以直接链接到这些特定部分，指引用户查看相关信息。

#### 链接到锚点

你可以在公开内容，或只读模式下的私密内容中，通过将鼠标悬停在标题上并点击 `#` 旁边出现的那个图标。这样会更新浏览器顶部栏中的 URL，你就可以复制它并在其他地方使用。

如果你想从你所在部分中的某个页面链接到特定锚点，你可以使用 [相对链接](/docs/documentation/zh/chuang-jian-nei-rong/formatting/inline.md#relative-links)，如果你更改标题，它会随之更新，以防止链接失效。

#### 编辑锚点

默认情况下，锚点链接会与标题中的文本完全相同。如果你打算在 GitBook 之外链接到该 URL，将来更改标题会导致锚点链接失效。届时链接会将访问者带到页面顶部，而不是锚点位置。

为避免这种情况，你可以通过打开 **选项菜单** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="/files/e1df373962dc4830bcb786d7e5cb3cce603367d3" alt="The Options menu icon in GitBook"></picture> 标题的，然后选择 **编辑锚点**。然后你可以输入你想使用的锚点链接——即使你更改标题本身，它也仍会保持为该锚点。

### Markdown 中的表示

GitBook 会生成经过 SEO 优化的页面，这意味着 GitBook 中的页面标题会自动在 Markdown 中表示为一级标题：

```markdown
# 我是一个页面标题
```

这意味着如果你 [将内容与 Git 同步](/docs/documentation/zh/wen-dang-ji-dai-ma/git-sync.md)，通过编辑器添加的页面标题将会以下一级标题表示：

{% code overflow="wrap" %}

```markdown
## 我的标题 1
### 我的标题 2
#### 我的标题 3
```

{% endcode %}

### 标题示例 <a href="#example-of-a-heading" id="example-of-a-heading"></a>

## 我的标题 1

### 我的标题 2

#### 我的标题 3

{% hint style="info" %}
页面标题与页面正文中的标题块是分开的。如果你在 **页面选项**中隐藏页面标题，你的 H1、H2 和 H3 标题仍会显示。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/heading.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
