Template:Message/doc
Usage
{{message}} displays a custom made message box.
Parameters
Parameter | Description |
---|---|
class |
Custom CSS class amendment |
bgcolor |
Background colour |
bdcolor |
Border colour |
fgcolor |
Foreground (text) colour |
image |
Image to be shown in the box |
imgwidth |
Image width (in pixels) |
style |
Custom CSS styling |
- Copy-paste templates
Size | Code |
---|---|
Basic | {{message|''text''}}
|
Common use | {{message|''text'' |bgcolor= |bdcolor= |image= }}
|
All parameters | {{message|''text'' |class= |bgcolor= |bdcolor= |fgcolor= |image= |imgwidth= |style= }}
|
Mandatory parameter
Text
- 1
Custom text string, wiki-formatting can be used. The parameter is unnamed, so no parameter name needs to be entered.
Note:
- If this parameter is left out, its name in the template code, "
{{{1}}}
", will be displayed.
- Usage
-
{{message|''text''}}
Optional parameters
Class
- class
A custom CSS class to append to the box's default class messagebox
, e.g. messagebox small
.
- Usage
-
{{message|1|class=class name}}
Colours
- bgcolor
The background colour of the box, defined as a CSS colour name (e.g. white
) or a hexadecimal colour code, e.g. #ffffff
for white. The default colour is #f9f6b7
.
- Usage
-
{{message|1|bgcolor=CSS/hex colour}}
- bdcolor
The border colour of the box, defined as a CSS colour name (e.g. black
) or a hexadecimal colour code, e.g. #000000
for black. The default colour is #c4c295
.
- Usage
-
{{message|1|bdcolor=CSS/hex colour}}
- fgcolor
The foreground colour of the box (i.e. text colour), defined as a CSS colour name (e.g. black
) or a hexadecimal colour code (e.g. #000000
for black). The default colour is black
.
- Usage
-
{{message|1|fgcolor=CSS/hex colour}}
Image
- image
You can choose a specific image to use for the template by using the image parameter. The image is displayed on the left side in the box, to the left of the text. The default image is Idea.png
(File:Idea.png).
Notes:
- When defining an image, don't include the namespace (
File:
orImage:
). That is inserted automatically.
- Usage
-
{{message|1|image=name.ext}}
- imgwidth
The width of the used image (in pixels). The default value is 35
.
Note:
- When defining the image width, don't include the unit (
px
orpixels
). That is inserted automatically.
- Usage
-
{{message|1|imgwidth=number value}}
CSS styling
- style
Optional CSS properties with corresponding values may be defined, without quotation marks " "
but with the ending semicolons ;
. The parameter specifies the style used by the entire message box.
- Usage
-
{{message|1|style=prop1:value1; prop2:value2;}}
Examples
Correct use
Parameter | What you write | What you see |
---|---|---|
1 |
{{message|You ''can'' '''use''' <sup>wiki</sup> <big>markup</big>}} |
|
class |
{{message|Custom text|class=text}} |
|
bgcolor |
{{message|Custom text|bgcolor=white}} |
|
{{message|Custom text|bgcolor=#ffffff}} |
||
bdcolor |
{{message|Custom text|bdcolor=black}} |
|
{{message|Custom text|bdcolor=#000000}} |
||
fgcolor |
{{message|Custom text|fgcolor=green}} |
|
{{message|Custom text|fgcolor=#008000}} |
||
image |
{{message|Custom text|image=Green check.png}} |
|
imgwidth |
{{message|Custom text|image=Green check.png|imgwidth=75}} |
|
style |
{{message|Custom text|style=text-align:right;}} |
Incorrect use
Example case | What you write | What you see (error) |
---|---|---|
No parameter | {{message}} |
See also
- {{message/box}} – the same as
{{message}}
, plus the option to define the maximum width of the box, and some other tweaks. - {{admon}} – four types of message boxes for various situations, based upon the template
{{message}}
. - {{label}} – strong message box for incredibly important messages. Use only if absolutely necessary.