This is a documentation subpage for Template:Monodiv. It contains usage information, categories and other content that is not part of the original page. |
This template uses TemplateStyles: |
Usage
{{monodiv|
text line 1
text line 2
text line 3}}
renders as:
text line 1
text line 2
text line 3This template is for formatting multi-line sections of content as plain, monospaced (nonproportional) text. It is a quick shorthand for the necessary CSS code. It is the multi-line version of {{mono}} and a replacement for <tt>...</tt>
, which is an obsolete element under HTML5. (Non-conforming features)
This template should be used where the content is being rendered in monospaced text for purely stylistic/display reasons, where this display has no particular semantic significance. Because it uses <div>...</div>
tags for formatting instead of <span>...</span>
tags, it can be used to wrap bulleted lists, along with div-based list templates like {{hlist}}.
It should not be used to indicate source code, nor for variables or variable input (use {{code}} or <code>...</code>
for code and {{var}} or <var>...</var>
for variables). For keyboard or samples, use <kbd>...</kbd>
or <samp>...</samp>
respectively.
When the content ends with a single closing curly brace (}
), the content should be followed by <nowiki/>
, for example, to mark up {foo}
, use {{monodiv|{foo}<nowiki/>}}
or {{monodiv|<nowiki>{foo}</nowiki>}}
.
If the content contains pipe characters (|
) not surrounded by <nowiki>...</nowiki>
, they must be escaped with |
or {{!}}
.
Parameters
There is only one parameter:
|1=
or unnamed- The content to format as monospaced. If the content contains a
=
character, the parameter must be numbered with|1=
.
See also
- {{mono}}
- {{pre}}
- {{code}}
- {{kbd}}
- {{samp}}
- {{var}}
- {{smalldiv}} (for wrapping multiple lines in small formatting)