Changes

Jump to navigation Jump to search
Fix typo
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
This template block-indents the value that is supplied to it. This is similar to block quotation, but it uses the HTML {{tag|div}} element, instead of [[Semantic HTML|semantically abusing]] the {{tag|blockquote}} element, which is only for [[block quotation]]s. It is also preferred over semantically abusing a colon at the start of the line, which should be used only for [[MOS:DEFLIST|description lists]].

<code><nowiki>{{block indent |1=</nowiki>{{var|The material to be indented here. May include markup, paragraph breaks, etc.}}<nowiki>}}</nowiki></code>

The default display differs from the block quotation template {{tl|Quote}} in that it does not:
* introduce whitespace margins above or below the indented material (just add a blank line above and/or below manually); nor
* indent from the right as well as the left (there is an optional parameter for this); nor
* affect the font size of its contents; nor
* (on mobile) bookend the block with large quotation marks.
* support that other template's attribution parameters (since it isn't for quotations).
* support plain blank-line paragraph breaks inside it.
Both templates support paragraph breaks using {{tag|p}} around second and subsequent paragraphs, as well as other HTML markup, and it is always safest to explicitly format with HTML rather than rely on MediaWiki's parser to do the right thing, as its behavior may be altered at any time by the developers.

===Example===

{{tlx|block indent |1{{=}}{{tl|Lorem}}}}

produces:

{{block indent |1={{Lorem}}}}

===Parameters===

{{para|1}} a.k.a. {{para|text}} The material to be indented. {{strong|It is always safest to explicitly define this with <code>1=</code>, not as an unnamed parameter}}, because any occurrence (e.g. in a URL, template, etc.) of the <code>=</code> character will break the template without it.

{{para|left}} a.k.a. {{para|em}} the value (e.g. <kbd>0.1</kbd> or <kbd>7</kbd>) in [[Em (typography)|<code>em</code> units]] by which to indent the material from the left; defaults to <code>3</code>

{{para|right}} the value, also in <code>em</code>, by which to indent the material from the right; defaults to <code>0</code> (use <kbd>7</kbd> to match the default left indentation)

{{para|style}} arbitrary CSS declarations, e.g. <code>font-size: 95%;</code>. This parameter should not normally be needed. Note: It already includes <code>overflow: hidden;</code> by default, to avoid collision of the div's background with floating elements.

{{para|class}} any CSS class names (e.g. as defined at [[MediaWiki:Common.css]]), comma-separated if more than one. This parameter should not normally be needed.

=== Comparison with {{tl|Quote}} (block quotation) ===
{| class="wikitable"
|-
! scope="col"|<nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki>
! scope="col"|{{tl|Quote}}
|-
| width="50%"| <code><nowiki>{{lorem}}{{block indent|1={{lorem}}<p>{{lorem}}</p>}}{{lorem}}</nowiki></code>
| width="50%"| <code><nowiki>{{lorem}}{{quote|1={{lorem}}<p>{{lorem}}</p>}}{{lorem}}</nowiki></code>
|-
| {{lorem}}{{block indent|1={{lorem}}<p>{{lorem}}</p>}}{{lorem}}
| {{lorem}}{{quote|1={{lorem}}<p>{{lorem}}</p>}}{{lorem}}
|}

=== Technical issues with block templates ===
{{Block bug documentation}}

==See also==
* {{tl|indent}}, which indents a single line, after a newline, using a mixture of en- and em-dash sized spaces.
* {{tl|spaces}}, which indents a single line (or content inline in one) uses non-breaking spaces.
* {{tl|in5}}, which indents a single line (or content inline in one), skipping up to fifty equal en-sized spaces.
* {{tl|quote}}, the block quotation template
* {{tl|hanging indent}}, the block hanging indent template

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Inline spacing templates]]
[[Category:Typing-aid templates]]
[[Category:Semantic markup templates]]
}}</includeonly>
Anonymous user

Navigation menu