This template is used by many other templates and pages. To avoid major disruption, changes should be discussed on the talk page before implementing them. |
Mbox stands for Message box. This is a meta template used to build message boxes for other templates, such as {{Notice}}. It offers several different colors and some other features. All templates that create a message box should use this template.
Usage
The box below shows the parameters that are accepted by {{Mbox}}. The purpose of each is described below.
{{mbox | size = | color = | style = | text = | image = | imageright = }}
size
The size parameter modifies the size of the message box.
The default size will produce:
This is the default sized message box and spans 80% of the page in the center. |
Using size=mbox-small
will produce:
This message box has a smaller font and image size and spans 40% of the page from the left. |
Using size=mbox-large
will produce:
This message box has a larger font and image size and spans the entire page. |
color
The color parameter applies color classes from Mediawiki:Citizen.css. The available colors are shown below. If no color parameter is specified the template defaults to gray.
color = pink - Used by {{Tip}} |
color = purple - Used by {{Obsidian}} |
color = violet - Used by {{In work}} |
color = blue – Used by {{Notice}}, {{Container category}}, {{Hidden category}} |
color = aqua |
color = teal |
color = green |
color = yellow – Used by {{Stub}} |
color = orange – Used by {{Important}}, {{Caution}}, {{High-use}} |
color = red |
color = gray/grey - – Used by {{Disambiguation}} |
style
The style parameter is used to apply CSS styling to the message box. Style can be used to modify the width, alter the font, choose a custom set of colors, and much more.
Values are inserted without quotation marks " "
but with the ending semicolons ;
.
For example, using style=font-family:cursive;
will produce:
This is a message box with cursive font. |
text
The text parameter fills in the text of the message box.
image
The image parameter changes the image that appears on the left. If no image parameter is specified the default image is Information grey.svg.
The default sized mbox formats the image to 40px. mbox-small formats it to 25px and mbox-large formats it to 55px.
Using image=MediaWiki-2020-large-icon.svg
will produce:
This message box has a different image. Thanks MediaWiki! |
imageright
The imageright parameter adds an image to the right side of the message box. This works the same as the image parameter, except that the default is no image.
Using imageright=Information grey.svg
will produce:
This message box has images on both sides. |
Categorization
This template does not categorize the pages it is used on. Templates that use this template should be categorized with Category:Mbox templates.
Technical notes
- The CSS for this template is defined in Template:Mbox/styles.css.
- If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and single curly brackets { } work fine. A pipe can be inserted using | or <nowiki>|</nowiki> Two cruly brackets can inserted using <nowiki>}}</nowiki> </div> }}
Equal sign = and single curly brackets { } work fine. A pipe can be inserted using | or | Two cruly brackets can inserted using }} |
- The
<div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
See also
- Wikipedia:Manual of Style/Article message boxes – The Wikipedia style guideline for creating article message boxes.
- Wikipedia:Template:Ambox - The Wikipedia ambox template.