Skip to content

Commit

Permalink
pure <h2> - <h5> tags for zh-CN (Part 2) (#6550)
Browse files Browse the repository at this point in the history
* pure `<h2>` - `<h5>` tags

* Apply suggestions from code review
  • Loading branch information
yin1999 authored Jun 28, 2022
1 parent d2faccd commit 46c7716
Show file tree
Hide file tree
Showing 200 changed files with 587 additions and 584 deletions.
10 changes: 5 additions & 5 deletions files/zh-cn/web/api/document/querycommandsupported/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<p><code><strong>Document.queryCommandSupported()</strong></code> 方法确定浏览器是否支持指定的编辑指令。</p>

<h2 id="Syntax" name="Syntax">语法</h2>
<h2 id="Syntax">语法</h2>

<pre class="syntaxbox"><var>isSupported</var> = document.queryCommandSupported(<em>command</em>);
</pre>
Expand All @@ -33,7 +33,7 @@ <h2 id="Syntax" name="Syntax">语法</h2>
<li>否则,此命令返回命令的值,如同 {{domxref("document.queryCommandValue()")}}.</li>
</ul>

<h2 id="Example" name="Example">示例</h2>
<h2 id="Example">示例</h2>

<pre class="brush:js">var flg = document.queryCommandSupported("SelectAll");

Expand All @@ -42,11 +42,11 @@ <h2 id="Example" name="Example">示例</h2>
}
</pre>

<h2 id="Specification" name="Specification">浏览器兼容性</h2>
<h2 id="Specification">浏览器兼容性</h2>

{{Compat("api.Document.queryCommandSupported")}}

<h2 id="Specification" name="Specification">规范</h2>
<h2 id="Specification">规范</h2>

<table class="spectable standard-table">
<tbody>
Expand All @@ -63,7 +63,7 @@ <h2 id="Specification" name="Specification">规范</h2>
</tbody>
</table>

<h2 id="See_also" name="See_also">参见</h2>
<h2 id="See_also">参见</h2>

<ul>
<li>{{domxref("document.execCommand")}}</li>
Expand Down
8 changes: 4 additions & 4 deletions files/zh-cn/web/api/document/queryselector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<p><strong>提示</strong>: 匹配是使用深度优先先序遍历,从文档标记中的第一个元素开始,并按子节点的顺序依次遍历。</p>
</div>

<h2 id="Syntax" name="Syntax">语法</h2>
<h2 id="Syntax">语法</h2>

<pre class="brush: js notranslate">element = document.querySelector(selectors);</pre>

Expand Down Expand Up @@ -45,7 +45,7 @@ <h3 id="异常">异常</h3>
<dd>指定<code>selectors</code>的语法无效。</dd>
</dl>

<h2 id="Notes" name="Notes">注意</h2>
<h2 id="Notes">注意</h2>

<p>如果选择器是一个 ID,并且这个 ID 在文档中错误地使用了多次,那么返回第一个匹配该 ID 的元素。</p>

Expand Down Expand Up @@ -91,11 +91,11 @@ <h2 id="规范">规范</h2>

{{Specifications}}

<h2 id="Browser_Compatibility" name="Browser_Compatibility">浏览器兼容性</h2>
<h2 id="Browser_Compatibility">浏览器兼容性</h2>

<p>{{Compat("api.Document.querySelector")}}</p>

<h2 id="See_also" name="See_also">相关链接</h2>
<h2 id="See_also">相关链接</h2>

<ul>
<li><a href="/zh-CN/docs/Web/API/Document_Object_Model/Locating_DOM_elements_using_selectors">Locating DOM elements using selectors</a></li>
Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/api/document/queryselectorall/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
---
<div>{{ ApiRef("DOM") }}</div>

<h2 id="Summary" name="Summary">概述</h2>
<h2 id="Summary">概述</h2>

<p>返回与指定的选择器组匹配的文档中的元素列表 (使用深度优先的先序遍历文档的节点)。返回的对象是 {{domxref("NodeList")}} 。</p>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/api/document/readystate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3 id="值">值</h3>
<dd>文档和所有子资源已完成加载。表示 {{event("load")}} 状态的事件即将被触发。</dd>
</dl>

<h2 class="editable" id="示例">示例</h2>
<h2 id="示例">示例</h2>

<h3 id="不同的准备状态">不同的准备状态</h3>

Expand Down
8 changes: 4 additions & 4 deletions files/zh-cn/web/api/document/releasecapture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
translation_of: Web/API/Document/releaseCapture
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<h3 id="Summary">概述</h3>
<p>如果该 document 中的一个元素之上当前启用了鼠标捕获,则释放鼠标捕获。通过调用 {{ domxref("element.setCapture()") }} 实现在一个元素上启用鼠标捕获。</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<h3 id="Syntax">语法</h3>
<pre class="eval">document.releaseCapture()
</pre>
<p>一旦释放鼠标捕获,鼠标事件将不再全部被定向到启用了鼠标捕获的元素。</p>
<h3 id="Example" name="Example">示例</h3>
<h3 id="Example">示例</h3>
<p>请参见 {{ domxref("element.setCapture()") }} 的 <a href="/en/DOM/element.setCapture#Example" title="en/DOM/element.setCapture#Example">示例</a></p>
<h3 id="Specification" name="Specification">规范</h3>
<h3 id="Specification">规范</h3>
<p>基于 Internet Explorer 的实现。</p>
<h3 id="参见">参见</h3>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions files/zh-cn/web/api/document/scripts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
translation_of: Web/API/Document/scripts
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<h3 id="Summary">概述</h3>
<p>返回一个{{ domxref("HTMLCollection") }}对象,包含了当前文档中所有{{ HTMLElement("script") }}元素的集合。</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<h3 id="Syntax">语法</h3>
<pre class="eval"><code>var <em>scriptList</em></code> = document.scripts;
</pre>
<p><code>scriptList</code> 是一个 {{ domxref("HTMLCollection") }} 对象。你可以像使用数组一样通过索引来获取其中包含的 {{ HTMLElement("script") }} 元素。</p>
Expand All @@ -18,5 +18,5 @@ <h3 id="例子">例子</h3>
  alert("该页面存在 script 标签!");
}
</pre>
<h3 id="Specification" name="Specification">浏览器兼容性</h3>
<h3 id="Specification">浏览器兼容性</h3>
{{Compat("api.Document.scripts")}}
8 changes: 4 additions & 4 deletions files/zh-cn/web/api/document/selectedstylesheetset/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p>表示当前使用的样式表集合的名称</p>

<h2 id="Syntax" name="Syntax">语法</h2>
<h2 id="Syntax">语法</h2>

<pre class="eval"><em>currentStyleSheetSet</em> = document.selectedStyleSheetSet

Expand All @@ -21,7 +21,7 @@ <h2 id="Syntax" name="Syntax">语法</h2>

<div class="note"><strong>注意:</strong> 这个属性的值是实时的,直接更改样式表中的<code>disabled</code>属性将会影响这个属性的值。</div>

<h2 id="Example" name="Example">示例</h2>
<h2 id="Example">示例</h2>

<pre class="brush: js">console.log("Current style sheet set: " + document.selectedStyleSheetSet);

Expand All @@ -30,7 +30,7 @@ <h2 id="Example" name="Example">示例</h2>

<div class="note"><strong>注意:</strong> 这个例子会帮助你理解设置<code>selectedStyleSheetSet</code> 的值和调用{{ domxref("document.enableStyleSheetsForSet()") }}之间行为的差异。</div>

<h2 id="See_also" name="See_also">参看</h2>
<h2 id="See_also">参看</h2>

<ul>
<li>{{ domxref("document.lastStyleSheetSet") }}</li>
Expand All @@ -39,7 +39,7 @@ <h2 id="See_also" name="See_also">参看</h2>
<li>{{ domxref("document.enableStyleSheetsForSet()") }}</li>
</ul>

<h2 id="Specification" name="Specification">规范</h2>
<h2 id="Specification">规范</h2>

<ul>
<li><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#alternate-style-sheets" title="http://www.whatwg.org/specs/web-apps/current-work/#alternate-style-sheets">HTML5: Alternate Style Sheets</a></li>
Expand Down
8 changes: 4 additions & 4 deletions files/zh-cn/web/api/document/stylesheetsets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

<p>返回一个所有当前可用样式表集的实时列表。</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>
<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox"><em>sets</em> = document.styleSheetSets
</pre>

<p>在返回时,sets 是一个可用的样式表集的列表。</p>

<h2 id="Example" name="Example">Example</h2>
<h2 id="Example">Example</h2>

<p>Given an {{HTMLElement("ul")}} (list) element with the ID "sheetList", you can populate it with the names of all the available style sheet sets with code like this:</p>

Expand All @@ -36,13 +36,13 @@ <h2 id="Notes">Notes</h2>

<p>The list of available style sheet sets is constructed by enumerating all the style sheets available for the document, in the order in which they're listed in the {{domxref("document.styleSheets")}} attribute, adding the <code>title</code> of each style sheet that has a title to the list. Duplicates are dropped from the list (using a case-sensitive comparison).</p>

<h2 id="Specification" name="Specification">Specifications</h2>
<h2 id="Specification">Specifications</h2>

<ul>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#alternate-style-sheets">HTML5: Alternate Style Sheets</a></li>
</ul>

<h2 id="See_also" name="See_also">See also</h2>
<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("Stylesheet")}}</li>
Expand Down
10 changes: 5 additions & 5 deletions files/zh-cn/web/api/document/title/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
---
<div>
{{APIRef}}</div>
<h2 id="Summary" name="Summary">概述</h2>
<h2 id="Summary">概述</h2>
<p>获取或设置文档的标题。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><em>var docTitle</em> = <em>document</em>.title;
</pre>
<p><code>title</code> 是一个包含 <code>document</code> 标题的字符串。如果通过设置 <code>document.title</code> 将标题覆盖,则返回覆盖后的值。否则返回标签里指定的标题(参见下面的 <a href="#notes">Notes</a>)。</p>
<pre class="syntaxbox"><em>document</em>.title = <em>newTitle</em>;
</pre>
<p><code>newTitle</code> 是文档的新标题。赋值操作影响 <code>document.title</code> 的返回值,文档的显示标题(即窗口或标签页顶部的标题栏),另外还会影响文档的 DOM,即改变 HTML 文档中 <code style="font-style: normal; line-height: 1.5;">&lt;title&gt;</code> 元素的内容。</p>
<h2 id="Example" name="Example">示例</h2>
<h2 id="Example">示例</h2>
<pre class="brush:js">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
Expand All @@ -31,11 +31,11 @@ <h2 id="Example" name="Example">示例</h2>
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2 id="Notes" name="Notes">备注</h2>
<h2 id="Notes">备注</h2>
<p>在 Gecko 中,该属性适应于 HTML、SVG、XUL 和其他文档。</p>
<p>对于 HTML 文档来说,<code>document.title</code> 的初始值是 <code>&lt;title&gt;</code> 元素的文本内容。对于 XUL 来说,它是 {{XULElem("window")}} 或其他顶级 XUL 元素的 {{XULAttr("title")}} 属性的值。</p>
<p>在 XUL 里,在文档完全加载之前访问 <code>document.title</code>,会有未定义行为(<code>document.title</code> 可能返回一个空字符串,并且设置 <code>document.title</code> 也无效)。</p>
<h2 id="Specification" name="Specification">规范</h2>
<h2 id="Specification">规范</h2>
<ul>
<li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-18446827">DOM Level 2 HTML: document.title</a></li>
<li><a class="external" href="http://www.whatwg.org/html/#document.title">HTML5</a></li>
Expand Down
6 changes: 3 additions & 3 deletions files/zh-cn/web/api/document/tooltipnode/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
translation_of: Web/API/Document/tooltipNode
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<h3 id="Summary">概述</h3>
<p>返回作为当前文档的{{ XULElem("tooltip") }}的节点。</p>
<h3 id="Usage" name="Usage">语法</h3>
<h3 id="Usage">语法</h3>
<pre class="eval">document.tooltipNode;
</pre>
<h3 id="Specification" name="Specification">规范</h3>
<h3 id="Specification">规范</h3>
<p>只能在 XUL 中使用。不属于任何规范.定义在{{ Source("dom/public/idl/xul/nsIDOMXULDocument.idl#59", "nsIDOMXULDocument.idl") }}.</p>
8 changes: 4 additions & 4 deletions files/zh-cn/web/api/document/url/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
translation_of: Web/API/Document/URL
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<h3 id="Summary">概述</h3>
<p>返回当前文档的 URL 地址</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<h3 id="Syntax">语法</h3>
<pre class="eval"><em>string</em> = document.URL
</pre>
<h3 id="Notes" name="Notes">备注</h3>
<h3 id="Notes">备注</h3>
<p><code>该属性的值和</code>DOM Level 0 中的<code>document.location.href</code> 属性的值是相等的。然而 <code>document.location.href</code> 是可写的,<code>document.URL</code> 是只读的。</p>
<p>{{ domxref("document.documentURI") }} 也返回与该属性相同的值,不过它在非 HTML 文档中也可以使用。</p>
<h3 id="Specification" name="Specification">规范</h3>
<h3 id="Specification">规范</h3>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-46183437">DOM Level 2 HTML: URL</a></p>
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h2 id="规范">规范</h2>

{{Specifications}}

<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
<h2 id="Browser_compatibility">浏览器兼容性</h2>

{{Compat}}

Expand Down
12 changes: 6 additions & 6 deletions files/zh-cn/web/api/document/width/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
<div class="geckoVersionNote">
<p>从 Gecko 6.0 开始,<code>不再支持 document.width,请使用</code><code>document.body.clientWidth</code>来代替。查看{{domxref("element.clientWidth")}}.</p>
</div>
<h2 id="Summary" name="Summary">概述</h2>
<h2 id="Summary">概述</h2>
<p>返回当前文档中的{{HTMLElement("body")}}元素的宽度,单位为像素.Internet Explorer 不支持该属性。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><em>pixels</em> = document.width;
</pre>
<h2 id="Example" name="Example">示例</h2>
<h2 id="Example">示例</h2>
<pre class="brush:js">function init() {
alert("当前文档的宽度为 " + document.width + " 像素.");
}
</pre>
<h2 id="Alternatives" name="Alternatives">请使用下面的属性来替代该属性</h2>
<h2 id="Alternatives">请使用下面的属性来替代该属性</h2>
<pre class="syntaxbox">document.body.clientWidth /* &lt;body&gt;元素的宽度 */
document.documentElement.clientWidth /* &lt;html&gt;元素的宽度 */
window.innerWidth /* window 的宽度 */
</pre>
<h2 id="Specification" name="Specification">规范</h2>
<h2 id="Specification">规范</h2>

<p>HTML5</p>

<h2 id="See_also" name="See_also">相关链接</h2>
<h2 id="See_also">相关链接</h2>
<ul>
<li>{{domxref("document.height")}}</li>
</ul>
4 changes: 2 additions & 2 deletions files/zh-cn/web/api/document/write/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2 id="备注">备注</h2>

<div class="note"><strong>注意:</strong>从 Chrome 55 开始,Chrome(可能)不会运行通过 <code>document.write()</code> 注入的<code>&lt;script&gt;</code>,以防止使用 2G 连接的用户找不到 HTTP 缓存。前往<a href="https://developers.google.cn/web/updates/2016/08/removing-document-write">此链接</a>查看这种情况发生需要满足的条件。</div>

<h2 id="规范" name="规范">规范</h2>
<h2 id="规范">规范</h2>

<table>
<thead>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h2 id="浏览器兼容性">浏览器兼容性</h2>

<p>{{Compat("api.Document.write")}}</p>

<h2 id="相关链接" name="相关链接">参见</h2>
<h2 id="相关链接">参见</h2>

<ul>
<li>{{ domxref("element.innerHTML") }}</li>
Expand Down
12 changes: 6 additions & 6 deletions files/zh-cn/web/api/document/writeln/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
translation_of: Web/API/Document/writeln
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<h3 id="Summary">概述</h3>
<p>向文档中写入一串文本,并紧跟着一个换行符。</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<h3 id="Syntax">语法</h3>
<pre class="eval">document.writeln(<em>line</em>);
</pre>
<h3 id="Parameters" name="Parameters">参数</h3>
<h3 id="Parameters">参数</h3>
<ul>
<li><code>line</code> 为包含文本的字符串</li>
</ul>
<h3 id="Example" name="Example">示例</h3>
<h3 id="Example">示例</h3>
<pre>document.writeln("&lt;p&gt;enter password:&lt;/p&gt;");
</pre>
<h3 id="Notes" name="Notes">备注</h3>
<h3 id="Notes">备注</h3>
<p><strong>document.writeln</strong><a href="/en/DOM/document.write" title="en/DOM/document.write">document.write</a> 一样,但是会添加一个换行符。</p>
<div class="note">
<strong>Note:</strong> <strong>document.writeln</strong> (like <strong>document.write</strong>) does not work in XHTML documents (you'll get a "Operation is not supported" (<code>NS_ERROR_DOM_NOT_SUPPORTED_ERR</code>) error on the error console). This is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml MIME type. More information is available in the <a class="external" href="http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite" title="http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite">W3C XHTML FAQ</a>.</div>
<h3 id="Specification" name="Specification">规范</h3>
<h3 id="Specification">规范</h3>
<p><a class="external" href="http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/html.html#ID-35318390">writeln </a></p>
Loading

0 comments on commit 46c7716

Please sign in to comment.