Template:Font/doc
Contents
Introduction
{{Font}} is based on CSS, and is used to define text styles like font, size, color, shadow and background color.
Structure
There are 8 parameters of this template:
Parameter | Introduction | Type | Default |
---|---|---|---|
class | The "class" attribute of the target text. | See also MediaWiki:Common.css | N/A |
title | Text comment. A "pop-up prompt box" will be displayed when hovering over the text. | Any character, except the pipe character(|), two consecutive curly braces({{ or }}). The pipe character can be replaced by {{!}} .
|
N/A |
font | The font(s) of the target text. | The name of font(s), Multiple fonts should be separated by half-width comma(s)(,); About the possible value, please see List of typefaces included with Microsoft Windows and List of typefaces included with macOS. | See also MediaWiki:Common.css |
size | The size of the target text. | A number; A unit such as px/em/ch/pt/% must be attached after the number, or you can use calc(), otherwise default unit is px. | 14px |
color | The color of the target text. | Color code; When using hexadecimal codes, please use a half-width pound sign(#) as prefix, like #000000. See also Help:List of colors. | black |
bgcolor | The background color of the target text. | Color code; Same as the above. | Transparent(i.e. No background) |
shadowcolor | The shadow color of the target text. | Color code; Same as the above. | No shadow |
css | Other CSS style for the target text. | Possible values are here→[1]. | N/A |
1 | name=value}}) will be identified as the parameter1. | Any character, except the pipe character(|), two consecutive curly braces({{ or }}). The pipe character can be replaced by {{!}} .
|
N/A; This is a required parameter. |
Use
{{Font|class=CLASS|title=TITLE|font=FONT|size=SIZE|color=COLOR|bgcolor=BACKGROUND COLOR|shadowcolor=SHADOW COLOR|css=CSS|TEXT}}
{{Font|class=CLASS|title=TITLE|font=FONT|size=SIZE|color=COLOR|bgcolor=BACKGROUND COLOR|shadowcolor=SHADOW COLOR|css=CSS|1=TEXT}}
Note:
- Except for parameter 1, other parameters are optional parameters. If omitted, the default value described in "Structure" will be used.
- Changing the order of the parameters will not affect the use.
- If there is a half-width equal sign(=) in the text, you must take the second usage, otherwise the text will not be displayed.
Examples
For example, the outcome of {{Font|color=#7f5620|font=Times New Roman|size=20px|Text is here.}}
is: Text is here.
Input | Outcome |
---|---|
{{Font|Plain text}}
|
Plain text |
{{Font|color=#7f5620|font=楷体|size=20px|啡色的文字。}}
|
啡色的文字。 |
{{Font|color=#bf00bf|font=Century Gothic|size=35px|Hello World!}}
|
Hello World! |
{{Font|bgcolor=#364d6a|color=#c9b295|font=Simhei|size=16px|囧囧囧囧囧}}
|
囧囧囧囧囧 |
{{Font|title=就像这样|bgcolor=#f9f9ef|color=#5a7aad|shadowcolor=blue|font=Simhei|size=24px|可以选用全部选项。}}
|
可以选用全部选项。 |
{{Font|size=25px|可以只选用其中一项选项。}}
|
也可以只选用其中一项选项。 |
{{Font|color=#FF0000|1=If there is a equal sign(=), then add "1=" at the beginning of the text.}}
|
If there is a equal sign(=), then add "1=" at the beginning of the text. |