Template:Font/doc
< Template:Font
Jump to navigation
Jump to search
Revision as of 13:17, 20 June 2023 by Gwyneth Llewelyn (talk | contribs) (Shamelessly copied from wikipedia.org and adapted for SL Wiki)
This is a documentation subpage for Template:Font. It contains usage information, categories and other content or metadata that is not part of the original template. |
This template is used in system messages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid large-scale disruption, any changes should first be tested in this template's /sandbox or /testcases subpage, or in your own user space. The tested changes can then be added in one single edit to this template. Please discuss any changes on the talk page before implementing them. |
About
{{font}} is used to define text styles, for example, size and color. It can also be used to inject CSS. This can be useful when needed to change "I" in Arial to "I" in Times New Roman, since in Arial, uppercase "I" looks the same as lowercase "L".
Use
{{font|TEXT(or「text=TEXT」)|font=FONT|size=SIZE(px/em/pt/%|color=COLOR|bgcolor=BACKGROUND COLOR|css=CSS}}
Parameter list
text
- The text to be changed.
font
- The text's font.
A list of fonts supported by Wikipedia can be found here: Wikipedia:Typography#Available fonts[1]. size
- The size of the text. Possible unit include
px
,em
,pt
,%
. color
- The color of the text.
bgcolor
- The background color.
css
- A CSS style.
Examples
Markup | Display |
---|---|
{{font|text=Some text.|font=|size=|color=}} |
Some text. |
{{font|text=Some text.|font=Comic Sans MS|size=20px|color=#7f5620}} |
Some text. |
{{font|Illinois|font=Times New Roman|size=20px}} |
Illinois |
{{font|Illinois|font=Arial|size=20px}} |
Illinois |
{{font|啡色的文字。|font=標楷體|size=20px|color=#7f5620}}
|
啡色的文字。 |
{{font|text=Hello World!|font=Century Gothic|size=35px|color=#bf00bf}}
|
Hello World! |
{{font|text=囧囧囧囧囧|font=Simhei|color=#c9b295|bgcolor=#364d6a}}
|
囧囧囧囧囧 |
{{font|text=可以選用全部選項。|font=Simhei|size=20px|color=#5a7aad|bgcolor=#f9f9ef}}
|
可以選用全部選項, |
{{font|text=也可以只選用其中一項選項。|size=25px}}
|
也可以只選用其中一項選項。 |
Defaults
Parameter | Default |
---|---|
font
|
Sans-serif |
size
|
100% |
color
|
black |
bgcolor
|
transparent |
Limitations
This template should not be used around multiple paragraphs. For example, it should not be used around multiple bullet or numbered points or more than one cell of a table. It may, however, surround as many uses of <br />
as desired.
Template data
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.
TemplateData for Font
Template data parameterlist
|
---|
{
"description": "Set text font, size, and color.",
"params": {
"text": {},
"1": {},
"font": {},
"size": {},
"color": {},
"bgcolor": {},
"title": {},
"css": {}
}
}
|
See also
- {{font color}}
- {{script}}
- ↑ Note that the SL Wiki might not have all of them installed