8000 docs(attribute): add translate attribute · hongyangAndroid/html-tutorial@edfee2e · GitHub
[go: up one dir, main page]

Skip to content

Commit edfee2e

Browse files
committed
docs(attribute): add translate attribute
1 parent 81c78f2 commit edfee2e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/attribute.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,21 @@
160160
- `rtl`:从右到左阅读,阿拉伯语、波斯语、希伯来语都属于这一类。
161161
- `auto`:浏览器根据内容的解析结果,自行决定 A35D
162162

163+
### translate
164+
165+
`translate`属性只用于文本元素,用来指示翻译软件,不翻译该文本。
166+
167+
```html
168+
<p>
169+
<span translate="no">Wien<span>
170+
named world's most liveable city (again)!
171+
</p>
172+
```
173+
174+
上面示例中,`translate="no"`用来告诉翻译软件,不要翻译`<span>`元素内的文本。
175+
176+
如果`translate`设为`yes`,就告诉翻译软件应该翻译该文本。
177+
163178
### contenteditable
164179

165180
HTML 网页的内容默认是用户不能编辑,`contenteditable`属性允许用户修改内容。它有两个可能的值。

0 commit comments

Comments
 (0)
0