Jump to content

Template:Hr/doc

From Wikipedia, the free encyclopedia

{{Hr}} displays a horizontal rule (horizontal line) which by default looks like this:


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

[edit]

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 or em after it.

Examples

[edit]

(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.

Alternatives

[edit]

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

[edit]

The information in this section is used by VisualEditor and tools such as TemplateWizard.

See a monthly parameter usage report for Template:Hr in articles based on its TemplateData.

TemplateData for Hr

Displays a horizontal rule (horizontal line).

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Height1

The thickness of the rule, in pixels.

Default
1
Example
1.5
Numberoptional