• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Hr/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Hr
This is the template sandbox page for Template:Hr (diff).
Template documentation[view] [edit] [history] [purge]
Displays a horizontal line
WarningThis template is used on approximately 9,100 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.
{{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.

Contents

  • 1 Usage
  • 2 Examples
  • 3 Alternatives
  • 4 Parameters

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[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Height1

The thickness of the rule, in pixels.

Default
1
Example
1.5
Numberoptional
The above documentation is transcluded from Template:Hr/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Hr/sandbox&oldid=1079926433"
Last edited on 29 March 2022, at 11:09

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 29 March 2022, at 11:09 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop