Template:Hr
![]() | This template is used on approximately 8,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
and whose thickness can be adjusted if desired. The rule appears on a line of its own, creating a line break if used mid-paragraph.
Usage
For the default appearance, insert {{hr}}
where you want the horizontal rule to appear. Text before {{hr}}
will appear above the rule, and text after it below.
To change the rule's thickness, use {{hr|height}}
, where height
is the thickness in pixels: for example {{hr|2}}
creates a rule two pixels thick.
- To make the rule thicker than the default, use a value bigger than 1.
- To make it thinner than the default, use a value smaller than 1.
- The thickness need not be a whole number.
- Enter just the number; don't add a unit such as
px
orem
after it.
Examples
(The horizontal rule produced by each of these examples is the one immediately below it. Any rule above it belongs to the preceding example.)
{{hr|0.5}}
sets the thickness to 0.5 pixels, creating a very thin line:{{hr}}
uses the default thickness, which is 1 pixel:{{hr|3}}
sets the thickness to 3 pixels:{{hr|5}}
sets the thickness to 5 pixels:- Placing the template within a line of text,
like {{hr}} this
,
- will split the text at the rule,
- like
this.
- like
Alternatives
A horizontal rule with the default appearance can also be produced by
- typing four hyphens
----
on a new line, or by - using an HTML
<hr />
tag.
The template simply inserts the HTML tag and gives it a style=
attribute if the thickness is specified. For example, {{hr|3}}
adds <hr style="height:3px" />
to the HTML for the page.
Parameters
The information in this section is used by VisualEditor and tools such as TemplateWizard.
TemplateData for Hr
Displays a horizontal rule (horizontal line).
Parameter | Description | Type | Status | |
---|---|---|---|---|
Height | 1 | The thickness of the rule, in pixels.
| Number | optional |