aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/global_attributes/spellcheck
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/global_attributes/spellcheck
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/html/global_attributes/spellcheck')
-rw-r--r--files/zh-cn/web/html/global_attributes/spellcheck/index.html213
1 files changed, 213 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/global_attributes/spellcheck/index.html b/files/zh-cn/web/html/global_attributes/spellcheck/index.html
new file mode 100644
index 0000000000..7e8214cd73
--- /dev/null
+++ b/files/zh-cn/web/html/global_attributes/spellcheck/index.html
@@ -0,0 +1,213 @@
+---
+title: spellcheck
+slug: Web/HTML/Global_attributes/spellcheck
+tags:
+ - spellcheck
+ - 拼写检查
+translation_of: Web/HTML/Global_attributes/spellcheck
+---
+<p class="note">{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}</p>
+
+<p>spellcheck<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes"> 全局属性</a>是枚举属性,定义是否可以检查元素的拼写错误。它可以具有以下值:<a href="/en-US/docs/Web/HTML/Global_attributes"> </a></p>
+
+<ul>
+ <li><code>true</code>, 设置在可能的情况下会去检查元素内容的拼写错误;</li>
+ <li><code>false</code>, 设置在可能的情况下关闭对元素内容拼写检查.</li>
+</ul>
+
+<p>如果没有设置这个属性,默认值由元素自身类型和浏览器设置决定。默认值也可以被继承,当有祖先元素的<em> spellcheck </em>设置为 <code>true</code> 的情况下,子元素的默认值也是 <code>true</code>。<br>
+ <br>
+ 你可以参考这篇文章的例子来使用这个属性。</p>
+
+<p>这个属性是枚举型而不是布尔类型. 这意味着显式设置其中一个值true或false是强制性的,如果使用简写 <code>&lt;label spellcheck&gt;Example Label&lt;/label&gt; 是不行的</code>。 正确的用法是<code> &lt;label spellcheck="true"&gt;Example Label&lt;/label&gt;</code>.</p>
+
+<p>这个属性仅仅是浏览器上的提示: 浏览器并不会强制去检查拼写错误,通常不可编辑的元素是不会去检查拼写错误的,就算它的spellcheck 属性被设置为true而且浏览器支持拼写检查。</p>
+
+<p>各个浏览器的默认设置和元素依赖:</p>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>浏览器</th>
+ <th>{{ HTMLElement("html") }}</th>
+ <th>{{ HTMLElement("textarea") }}</th>
+ <th>{{ HTMLElement("input") }}</th>
+ <th>其他</th>
+ <th>附注</th>
+ </tr>
+ <tr>
+ <td rowspan="3">Firefox</td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <code>0</code></td>
+ </tr>
+ <tr>
+ <td><strong><code>false</code></strong></td>
+ <td><strong><code>true</code></strong></td>
+ <td><strong><em>inherited</em></strong></td>
+ <td><strong><em>inherited</em></strong></td>
+ <td><strong>当 <code>layout.spellcheckDefault</code> 值为 <code>1</code> (default value)</strong></td>
+ </tr>
+ <tr>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <code>2</code></td>
+ </tr>
+ <tr>
+ <td rowspan="3">Seamonkey</td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <span style="font-family: Courier New;"><code>0</code></span></td>
+ </tr>
+ <tr>
+ <td><strong><code>false</code></strong></td>
+ <td><strong><code>true</code></strong></td>
+ <td><strong><em>inherited</em></strong></td>
+ <td><strong><em>inherited</em></strong></td>
+ <td><strong>当 <code>layout.spellcheckDefault</code> 值为 <span style="font-family: Courier New;">1</span><strong>(默认如此)</strong></strong></td>
+ </tr>
+ <tr>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <span style="font-family: Courier New;"><code>2</code></span></td>
+ </tr>
+ <tr>
+ <td rowspan="3">Camino</td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <span style="font-family: Courier New;"><code>0</code></span></td>
+ </tr>
+ <tr>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td><em>inherited</em></td>
+ <td><em>inherited</em></td>
+ <td>当 <code>layout.spellcheckDefault</code> 值为 <span style="font-family: Courier New;"><code>1</code></span></td>
+ </tr>
+ <tr>
+ <td><strong><code>false</code></strong></td>
+ <td><strong><code>true</code></strong></td>
+ <td><strong><code>true</code></strong></td>
+ <td><strong><em>inherited</em></strong></td>
+ <td><strong>当 <span style="font-family: Courier New;">layout.spellcheckDefault</span> 值为 <span style="font-family: Courier New;"><code>2</code></span><strong>(默认如此)</strong></strong></td>
+ </tr>
+ <tr>
+ <td>Chrome</td>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td>?</td>
+ <td><em>inherited</em></td>
+ </tr>
+ <tr>
+ <td>Internet Explorer</td>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td>?</td>
+ <td><em>inherited</em></td>
+ </tr>
+ <tr>
+ <td>Opera</td>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td>?</td>
+ <td><em>inherited</em></td>
+ </tr>
+ <tr>
+ <td>Safari</td>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
+ <td>?</td>
+ <td><em>inherited</em></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">附注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', "interaction.html#spelling-and-grammar-checking", "spellcheck")}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>与最新的快照相比没有变化, {{SpecName('HTML5.1')}}</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', "editing.html#spelling-and-grammar-checking", "spellcheck")}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td>{{SpecName('HTML WHATWG')}} 的快照,初始定义</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>功能</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatGeckoDesktop("1.8.1") }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>功能</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown}}</td>
+ <td>{{ CompatGeckoMobile("1.8.1") }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="另见">另见</h2>
+
+<ul>
+ <li>所有 <a href="/en-US/docs/Web/HTML/Global_attributes">全局属性</a></li>
+</ul>