Template:Messagebox1/doc

Parameters
The first unnamed parameter will determine the icon displayed and give the table a class.

You can replace the default icon with something else using the image parameter, e.g.: produces:

Alternatively, the first parameter can be arbitrary wikicode, e.g. a math tag, or an image of any size:

produces:

produces:

It can also be omitted entirely, in which case no icon will be displayed.

See the category for more icons.

The second unnamed parameter will be the contents of the messagebox.

The class parameter can be used to add one or more css classes to the box. For example, mb-fullwidth will make the box 100% wide instead of 80%.

Multiple classes should be separated by whitespace.

Nesting
You can use a messagebox within the text part of a messagebox. The nested messagebox will automatically be shrinked, its borders will be removed and a separator line will be added above.

Styling
The class parameter can be used to add a class specific to one template, to change the style of that one template. For example, Template:Mothball uses the class mothball to change the background color.

To avoid name clashes use the mb prefix for messagebox class names.

To style the messagebox using a class, use the css selector .messagebox.classname. For example, the background of Template:Mothball is changed by the following code :

To style the table cells (both the image and the text):

The table cells also have classes that allow you to style them separately, these are mb-image and mb-text. The following example changes the background color of the image to green and the font color of the text to blue:

Note that since the purpose of this template is to give message boxes a consistent look, per-template styling should be kept to a minimum.