• Home
  • Random
  • Log in
  • Settings
Donate Now If this site has been useful to you, please give today.
  • About Wikisource
  • Disclaimers
Wikisource

Template:Rule

  • Template
  • Discussion
  • Language
  • Watch
  • View source

Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 361,000 pages, or roughly 8% 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.
CSSThis template uses TemplateStyles:
  • Template:Rule/styles.css (sandbox)

Contents

  • 1 Usage
    • 1.1 Width
    • 1.2 Height
    • 1.3 Alignment
    • 1.4 Top/bottom margins
    • 1.5 Class
    • 1.6 Style
  • 2 Redirects
  • 3 See also

Usage

This template inserts a 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



Template:Double rule may be used as shorthand for this.

Width

A width may optionally be provided, in em or by % in which case a horizontal rule of that width is centered on the line.

For example

{{rule|width=12em}}

and

{{rule|12em}}

both produce


Height

Height is provided by the named height parameter:

{{rule|height=3px}}

Alignment

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 margins

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

Class

This template applies the class(es) .wst-rule, which can be targeted with a work's index styles.css using page styles.

Style

Finally, any desired special HTML styling may be applied through the style parameter.

For example

{{rule|width=12em|height=1em|style=background-color:orange;color:inherit;border:1px solid}}

produces


Redirects

  • {{Hline}}

See also

  • {{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

Adds a horizontal rule to content.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
width1 width

width of rule. (CSS 'units specifcations should be used)

Stringsuggested
classclass

CSS classes to apply to the created HR element.

Stringoptional
colorcolor

color that should be applied to the rule, CSS style color specifications should be used.

Stringoptional
alignalign

(Option) Aligns the rule with the left or right of the containing content.

Suggested values
left right
Stringoptional
margin_tbmargin_tb

Vary the vertical spacing around the rule. (uses CSS unit specifcations.)

Stringoptional
heightheight 2

Varies the vertical height of the rule (Uses CSS units)

Stringoptional
stylestyle

Additional CSS styles to be applied to the 'rule'

Stringoptional
margin-topmargin-top

no description

Unknownoptional
margin-tbmargin-tb

no description

Unknownoptional
margin-bottommargin-bottom

no description

Unknownoptional
The above documentation is transcluded from Template:Rule/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikisource.org/w/index.php?title=Template:Rule&oldid=14700554"
Last edited on 5 December 2024, at 09:02

Languages

    • العربية
    • অসমীয়া
    • Беларуская
    • বাংলা
    • Català
    • Čeština
    • Cymraeg
    • Dansk
    • Ελληνικά
    • Esperanto
    • Español
    • فارسی
    • Français
    • ગુજરાતી
    • Հայերեն
    • Bahasa Indonesia
    • Íslenska
    • Italiano
    • 日本語
    • Jawa
    • 한국어
    • Latina
    • Ligure
    • Македонски
    • മലയാളം
    • Bahasa Melayu
    • မြန်မာဘာသာ
    • Napulitano
    • Nederlands
    • Norsk bokmål
    • ଓଡ଼ିଆ
    • ਪੰਜਾਬੀ
    • Polski
    • Português
    • Română
    • Русский
    • Slovenčina
    • Svenska
    • தமிழ்
    • ไทย
    • Türkçe
    • Українська
    • Vèneto
    • Tiếng Việt
    • 中文
    Wikisource
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 5 December 2024, at 09:02.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikisource
    • Disclaimers
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop