> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/thymeleaf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/thymeleaf/i.-using-thymeleaf/4-standard-expression-syntax/4.5-fragments.md).

# 4.5 分段

分段表达式是代表标记段落，在模版间移动它们的简单的方法。这允许我们复制它们，把它们作为参数传递给其它模版，等等。

分段插入是最普遍的用法，使用`th:insert`或者`th:replace`（在之后的章节会有更多关于这些的内容）：

```markup
<div th:insert="~{commons :: main}">...</div>
```

但是，它们可以在任何地方使用，就像其它的变量一样：

```markup
<div th:with="frag=~{footer :: #main/text()}">
  <p th:insert="${frag}">
</div>
```

在此教程的后面部分，有一个完整的章节专注于模版设计，包括对分段表达式的更深层次的探索。
