Difference between revisions of "Template:Font/doc"
m ([InPageEdit] →Structure) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 21: | Line 21: | ||
|'''font''' | |'''font''' | ||
|The font(s) of the target text. | |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 [[ | + | |The name of font(s), Multiple fonts should be separated by half-width comma(s)(''','''); About the possible value, please see [[enwp:List_of_typefaces_included_with_Microsoft_Windows|List of typefaces included with Microsoft Windows]] and [[enwp:List_of_typefaces_included_with_macOS|List of typefaces included with macOS]]. |
|See also [[MediaWiki:Common.css]] | |See also [[MediaWiki:Common.css]] | ||
|- | |- | ||
Line 50: | Line 50: | ||
|- | |- | ||
|'''1''' | |'''1''' | ||
− | |The content of the target text. The first parameter that you don't give a name(i.e. <code><nowiki>{{font|name=VALUE}}</nowiki></code>) will be identified as the parameter'''1'''. | + | |The content of the target text. The first parameter that you don't give a name(i.e. <code><nowiki>{{font|name=VALUE}}</nowiki></code>) will be identified as the parameter '''1'''. |
|Any character, except the pipe character('''<nowiki>|</nowiki>'''), two consecutive curly braces(<nowiki>{{</nowiki> or <nowiki>}}</nowiki>). The pipe character can be replaced by <code><nowiki>{{!}}</nowiki></code>. | |Any character, except the pipe character('''<nowiki>|</nowiki>'''), two consecutive curly braces(<nowiki>{{</nowiki> or <nowiki>}}</nowiki>). The pipe character can be replaced by <code><nowiki>{{!}}</nowiki></code>. | ||
|''N/A''; '''This is a required parameter.''' | |''N/A''; '''This is a required parameter.''' | ||
Line 96: | Line 96: | ||
== References == | == References == | ||
<references /> | <references /> | ||
+ | <noinclude> | ||
+ | {{Formatting templates}} | ||
+ | </noinclude> | ||
<includeonly> | <includeonly> | ||
− | + | [[Category:Formatting templates]] | |
− | [[Category: | ||
</includeonly> | </includeonly> |
Latest revision as of 21:18, 22 March 2023
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 | The content of the target text. The first parameter that you don't give a name(i.e. {{font|name=VALUE}} ) will be identified as the parameter 1.
|
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. |
References
|