defzone.net@gmail.comLiên hệ
DZ
DefZone.Net

Kien thuc cong nghe & giai tri

Bai vietDia diemAlbum anhGameCua hang
  1. Home
  2. Wiki
Template documentation[view] [edit] [history] [purge]
Displays a horizontal line
WarningThis template is used on approximately 6,400 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 height 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 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

[edit]

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

[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 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

[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.
DZ
DefZone.Net

Noi chia se kien thuc, huong dan va kham pha cong nghe.

Lien ket nhanh

Trang chủBài viếtWikiCửa hàngLiên hệ

Liên hệ

Email: defzone.net@gmail.com
Điện thoại: +84 762 559 696
Địa chỉ: Thiên Hương, Thủy Nguyên, Hải Phòng

Đăng ký nhận tin

Nhận bài viết và cập nhật mới nhất qua email.

© 2026 DefZone.Net. All rights reserved.
PrivacyTermsSitemap