HTML translate 屬性
定義和用法
translate
規定是否應該翻譯元素內容。
測試:請點擊 Google 翻譯圖標(在頁面頂部搜索按鈕的旁邊),切換到另一種語言,看看下面的 "ice cream" 會發生什么:
在這里,我們使用 translate="no": ice cream。
另請參閱:
HTML 教程:HTML 屬性
實例
規定不應翻譯某些元素:
<p translate="no">Don't translate this!</p> <p>This can be translated to any language.</p>
語法
<element translate="yes|no">
屬性值
值 | 描述 |
---|---|
yes | 規定應該翻譯元素內容。 |
no | 規定不應翻譯元素內容。 |
瀏覽器支持
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
不支持 | 不支持 | 不支持 | 不支持 | 不支持 |