Template:Hr
| This template is used on approximately 6,700 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 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
heightvalue 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
heightdifferences might render the same. - A
heightless 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
heightless than 1 is not recommended. See Examples and testing for the current renderings on your particular device.
- Small
- Enter just the number; don't add a unit such as
pxoremafter it. - Placing the template within a line of text,
like {{hr}} this,
- will split the text at the rule,
- like
this
- like
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.
TemplateData for Hr
Displays a horizontal rule (horizontal line).
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Height | 1 | The thickness of the rule, in pixels.
| Number | optional |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.