aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/hr
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/element/hr
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/element/hr')
-rw-r--r--files/zh-cn/web/html/element/hr/index.html120
1 files changed, 120 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/hr/index.html b/files/zh-cn/web/html/element/hr/index.html
new file mode 100644
index 0000000000..0cb5efd486
--- /dev/null
+++ b/files/zh-cn/web/html/element/hr/index.html
@@ -0,0 +1,120 @@
+---
+title: <hr>
+slug: Web/HTML/Element/hr
+tags:
+ - Element
+ - HTML
+ - HTML grouping content
+ - Reference
+ - 元素
+ - 参考
+translation_of: Web/HTML/Element/hr
+---
+<div>{{HTMLRef}}</div>
+
+<p><strong>HTML <code>&lt;hr&gt;</code> 元素</strong>表示段落级元素之间的主题转换(例如,一个故事中的场景的改变,或一个章节的主题的改变)。</p>
+
+
+
+<p>在HTML的早期版本中,它是一个水平线。现在它仍能在可视化浏览器中表现为水平线,但目前被定义为语义上的,而不是表现层面上。所以如果想画一条横线,请使用适当的css样式来修饰。</p>
+
+<div>{{EmbedInteractiveExample("pages/tabbed/hr.html", "tabbed-shorter")}}</div>
+
+<div class="note">
+<p>要更改 &lt;hr&gt; 与段落之间的间隙或样式,请使用 <a href="/en-US/docs/CSS">CSS</a>。</p>
+</div>
+
+<ul class="htmlelt">
+ <li><dfn><a href="/zh-cn/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">流式元素</a>.</li>
+ <li><dfn>允许的内容</dfn>无, 是一个 {{Glossary("空元素")}}.</li>
+ <li><dfn>标签省略</dfn>必须有开始标签, 不能有结束标签。</li>
+ <li><dfn>允许的父元素</dfn> 所有接受<a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">流式元素</a>的元素。</li>
+ <li><dfn>DOM接口</dfn> {{domxref("HTMLHRElement")}}</li>
+</ul>
+
+<h2 id="属性">属性</h2>
+
+<p>该元素包含<a href="zh-CN/docs/Web/HTML/Global_attributes">全局属性</a></p>
+
+<dl>
+ <dt>{{htmlattrdef("align")}} {{deprecated_inline}}</dt>
+ <dd>设置对齐方式. 如果没有值, 默认值为 <code>left。</code></dd>
+ <dt>{{htmlattrdef("color")}} {{Non-standard_inline}}</dt>
+ <dd>使用颜色名或十六进制设置颜色。</dd>
+ <dt>{{htmlattrdef("noshade")}} {{deprecated_inline}}</dt>
+ <dd>去除阴影。</dd>
+ <dt>{{htmlattrdef("size")}} {{deprecated_inline}}</dt>
+ <dd>使用像素设置高度。</dd>
+ <dt>{{htmlattrdef("width")}} {{deprecated_inline}}</dt>
+ <dd>使用像素或者百分比设置宽度。</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="notranslate"><code>&lt;p&gt;
+ This is the first paragraph of text.
+ This is the first paragraph of text.
+ This is the first paragraph of text.
+ This is the first paragraph of text.
+&lt;/p&gt;
+
+&lt;hr&gt;
+
+&lt;p&gt;
+ This is the second paragraph of text.
+ This is the second paragraph of text.
+ This is the second paragraph of text.
+ This is the second paragraph of text.
+&lt;/p&gt;</code></pre>
+
+<h3 id="结果">结果</h3>
+
+<p>{{EmbedLiveSample("Example")}}</p>
+
+<h2 id="Specifications" name="Specifications">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'grouping-content.html#the-hr-element', '&lt;hr&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>Definition of the <code>hr</code> element</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'rendering.html#the-hr-element-0')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>Suggested default rendering of the <code>hr</code> element</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'grouping-content.html#the-hr-element', '&lt;hr&gt;')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML4.01', 'present/graphics.html#h-15.3', '&lt;hr&gt;')}}</td>
+ <td>{{Spec2('HTML4.01')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("html.elements.hr")}}</p>
+
+<h2 id="相关内容">相关内容</h2>
+
+<ul>
+ <li>{{HTMLElement('p')}}</li>
+</ul>