<hr>

  • Revision slug: HTML/Element/hr
  • Revision title: hr
  • Revision id: 1864
  • Created:
  • Creator: Rappo
  • Is current revision? No
  • Comment

Revision Content

HTML Horizontal Rule Element

...<hr> - This element is used to insert a horizontal rule to visually separate document sections. Rules usually are rendered as a raised or etched line.

Attributes

align
Sets the alignment of the rule on the page. If no value is specified, the default value is left.
color
Sets the color of the rule through color name or hexadecimal value.
noshade
Sets the rule to have no shading.
size
Sets the height, in pixels, of the rule.
width
Sets the length of the rule on the page through a pixel or percentage value.

Example

  Text separated by a horizontal rule.
    <hr align="center" size="2" width="80%">
  Text separated by a horizontal rule.

Result

Text separated by a horizontal rule.


Text separated by a horizontal rule.

Notes

Although not required by HTML, the horizontal rule element must receive a closing tag in XHTML therefore making the tag for this element <hr />.

{{wiki.template('HTML:Element_Navigation')}}

Revision Source

<h2 name="HTML_Horizontal_Rule_Element"> HTML <i>Horizontal Rule</i> Element </h2>
<p><b>...&lt;hr&gt;</b> - This element is used to insert a horizontal rule to visually separate document sections. Rules usually are rendered as a raised or etched line.
</p>
<h3 name="Attributes"> Attributes </h3>
<dl><dt>align
</dt><dd>Sets the alignment of the rule on the page.  If no value is specified, the default value is <code>left</code>.
</dd><dt>color
</dt><dd>Sets the color of the rule through color name or hexadecimal value.
</dd><dt>noshade
</dt><dd>Sets the rule to have no shading.
</dd><dt>size
</dt><dd>Sets the height, in pixels, of the rule.
</dd><dt>width
</dt><dd>Sets the length of the rule on the page through a pixel or percentage value.
</dd></dl>
<h3 name="Example"> Example </h3>
<pre class="eval">  Text separated by a horizontal rule.
    &lt;hr align="center" size="2" width="80%"&gt;
  Text separated by a horizontal rule.
</pre>
<h4 name="Result"> Result </h4>
<p>Text separated by a horizontal rule.
</p>
<hr size="2" width="80%">
<p>Text separated by a horizontal rule.
</p>
<h3 name="Notes"> Notes </h3>
<p>Although not required by <a href="en/HTML">HTML</a>, the horizontal rule element must receive a closing tag in <a href="en/XHTML">XHTML</a> therefore making the tag for this element <b>&lt;hr /&gt;</b>.
</p><p>{{wiki.template('HTML:Element_Navigation')}}
</p>
Revert to this revision