> 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/5-setting-attribute-values/5.3-setting-more-than-one-value-at-a-time.md).

# 5.3 一次设置多个值

有两个比较特殊的属性，称为`th:alt-title` 和`th:lang-xmllang`。它们用于同时把两个属性设置为相同的值。特别地：

* `th:alt-title`会设置`alt`和`title`。
* `th:lang-xmllang`会设置`lang`和`xml:lang`。

对于我们的主页，这允许我们将以下内容：

```markup
<img src="../../images/gtvglogo.png" 
     th:attr="src=@{/images/gtvglogo.png},title=#{logo},alt=#{logo}" />
```

或者，以下相等的内容：

```markup
<img src="../../images/gtvglogo.png" 
     th:src="@{/images/gtvglogo.png}" th:title="#{logo}" th:alt="#{logo}" />
```

替换为:

```markup
<img src="../../images/gtvglogo.png" 
     th:src="@{/images/gtvglogo.png}" th:alt-title="#{logo}" />
```
