![]() | This is a documentation subpage for Template:Rule. It contains usage information, categories and other content that is not part of the original template page. |
![]() | This template is used on approximately 259,000 pages, or roughly 7% of all pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
UsageEdit
This template inserts a black horizontal rule. It should be used in transcriptions in preference to wiki syntax "----", which inserts a rule but in a lighter colour. Furthermore there can be no certainty that the rendering of "----" will not change in the future. Please check for any [X]HTML 5 issues as well.
For example
{{rule}}
produces
The common case of a double-rule can be achieved by
{{rule}}{{rule}}
which produces
WidthEdit
A width may optionally be provided, in em or by % in which case a black horizontal rule of that width is centered on the line.
For example
{{rule|width=12em}}
and
{{rule|12em}}
both produce
HeightEdit
Height is provided by the named height parameter:
{{rule|height=3px}}
AlignmentEdit
In rare cases where the left or right alignment is required, the align parameter may be used.
Example
{{rule|6em|align=left}}
produces
Top/bottom marginsEdit
If the rule has wider padding around it, this can be set with margin_tb:
Example
{{center| Foo {{rule|margin_tb=2em}} Bar }}
produces
Foo
Bar
ClassEdit
This template applies the class(es)
.wst-rule
that can be targeted with a work's index styles.css using page styles
StyleEdit
Finally, any desired special HTML styling may be applied through the style parameter.
For example
{{rule|width=12em|height=1em|style=background-color:orange;border:1px solid black}}
produces
RedirectsEdit
- {{Hline}}
See alsoEdit
- {{section end rule}} for a semantic rule at the end of a section
- {{separator}} for a row of dots
- {{custom rule}} for a customized decorative rule
- {{longdash}} for an inline long dash
- {{bar}} for an inline, user specified length of the dash