Jump to content

Template:Hr/doc

From FoxLabs Wiki
Revision as of 12:47, 4 June 2026 by Inari (talk | contribs) (Created page with "{{Short description|Displays a horizontal line}} {{Documentation subpage}} {{vpad|1.5em}}<!-- to separate body text from the banner above --> '''<nowiki>{{Hr}}</nowiki>''' displays a '''horizontal rule''' (horizontal line) which by default looks like this: {{hr}} and whose height 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 <code><nowiki>{{hr}}</nowiki></c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Vpad

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


and whose height 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 height, use {{hr|height}}, where height is the thickness in pixels: for example {{hr|2}} creates a rule two pixels high.

  • The height value need not be a whole number.
  • To make the rule thicker (taller) than the default, use a value greater than 1.
  • To make it thinner than the default, use a value between 0 and 1, exclusive.
  • On lower-resolution displays:
    • Small height differences might render the same.
    • A height less than 1 might render nothing (an "invisible line").
      • For any given device, a visible line might become invisible, or vice versa, depending on what precedes it on the page. Thus, unrelated edits can affect the rendering.
    • All of these effects were seen on a Windows laptop display, at 1366x768 resolution, in AD 2025. For these reasons, a height less than 1 is not recommended. See Examples and testing for the current renderings on your particular device.
  • Enter just the number; don't add a unit such as px or em after it.
  • Placing the template within a line of text,
like {{hr}} this,
will split the text at the rule,
like
this

Examples and testing

Rendering varies slightly depending on display resolution; see Usage.

Coding Resulting line height on your display, today
{{hr|0.5}}
{{hr|1}} or {{hr}}
{{hr|1.5}}
{{hr|2}}
{{hr|2.5}}
{{hr|3}}
{{hr|4}}
{{hr|5}}
{{hr|10}}

(At this point, we have a horizontal bar, not a horizontal rule. Some judicious restraint is recommended, making the line height proportional to [not equal to] that of the nearby text. {{hr|10}} is excessive for most uses.)

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 inserts the HTML tag and gives it a style= attribute if the height 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.

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