Template:Block indent/doc: Difference between revisions
en>RogueScholar |
m 1 revision imported |
(No difference)
| |
Latest revision as of 12:40, 19 October 2026
| This is a documentation subpage for Template:Block indent. It contains usage information, categories and other content that is not part of the original template page. |
| Warning | This template is used in system messages, and on approximately 522,000 pages, or roughly 5855% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. 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. Please discuss changes on the talk page before implementing them. |
| CSS | This template uses TemplateStyles: |
The {{Block indent}} template adds an indented content block to a page.
Usage[edit source]
{{Block indent|1=The material to be indented here. May include markup, paragraph breaks, etc.}}
Example[edit source]
{{Block indent|1=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}}
TemplateData[edit source]
TemplateData for Block indent
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Indented content | 1content quote text | The page content to display indented. This should always be defined as a named, not an unnamed, parameter to avoid parser errors. | Content | required |
| Left indentation width | leftem | A valid CSS length value (e.g. 0.1 or 7) in em units by which to indent the material from the left page margin
| Number | optional |
| Right indentation width | right | A valid CSS length value, also in em units, by which to indent the material from the right page margin (define as 7 to match the default left margin indentation)
| Number | optional |
| Custom styling | style | Custom CSS style declarations to be added following the default ( overflow: hidden;), each terminated by a semicolon
| Line | optional |
| CSS classes | class | Additional CSS class names (e.g. as defined at MediaWiki:Common.css) to declare alongside the default ( block-indent), whitespace-delimited if more than one
| Line | optional |
Format: inline
Alternatives that are not recommended[edit source]
A colon at the start of the line produces a similar indent, but it produces incorrect HTML; see Wikipedia:Manual of Style § Indentation for more details. (An initial : was intended only for use after ; in constructing description lists, but many editors have used it ubiquitously for simple indentation.)
{{Blockquote}} employs the HTML <blockquote>...</blockquote> element and is intended for use only with actual block quotation; using it for indenting simple block elements breaks semantic HTML and the appearance differs. (Whereas {{Block indent}} employs an HTML <div>...</div> element with padding offsetting it from the left and/or right page margins.)
The default display of {{Block indent}} differs from that of {{Blockquote}} in that it does not:
- introduce vertical whitespace above or below the indented material (add blank lines above and/or below manually, as needed)
- indent from the right as well as the left (though the optional Template:Parameter parameter triggers this behavior)
- affect the font size of its contents
- bookend the block with large quotation marks on mobile devices
- support plain blank-line paragraph breaks inside it, or
- support attribution parameters (because {{Block indent}} isn't for quotations).
{{Blockquote}} and {{Block indent}} both support internal paragraph breaks through the use of HTML <p>...</p> tags around subsequent paragraphs, as well as other HTML markup. It is always safest to explicitly format using raw HTML rather than rely on MediaWiki's parser because future updates to it could alter the output at any time.
Comparison with Template:Blockquote[edit source]
| {{Block indent}}[a] | {{Blockquote}}[b] |
|---|---|
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
Technical issues with block templates[edit source]
Template:Block bug documentation
See also[edit source]
Template:Block indentations templates
- {{Blockquote}}, only for use with block quotations
- {{Hanging indent}}
- {{Indent}} – indents a single line, after a newline, using a mixture of en and/or em spaces
- {{Indent 5}} – indents a single line (or portion of inline content) using up to fifty (50) equal en spaces
- {{Spaces}} – indents a single line (or portion of inline content) using non-breaking spaces
Template:Semantic markup templates