Template:Font color
链接 请 |
此Template |
用途
{{Font color}} 你可以这样
{{Font color}} 也可以给维基链接|link =
|link=
这个<span style=color:color>...</span>
<span style=background-color:color>...</span>
,以
用法
{{Font color}}
- {{font color |
文字 颜色 |文字 }} - {{font color |
文字 颜色 |背景 颜色 |文字 }}.
两种
- |link=yes →
[[
文字 ]] - |link=fullpagename →
[[页面
地 址 ]]
你也
- {{font color | fg=color | text=text }}
- {{font color | fg=
文字 颜色 | bg=背景 颜色 | text=文字 }}
你也
.
{{font color|tan|green|text with four words}}.
→.
text with four words.
.
{{font color|tan|green|text with four words}}.
→.
text with four words.
.
{{ font color | tan | green | text with four words }}.
→.
text with four words.
参 数
Use / description | Default value | |
{{{1}}} | | inherited |
{{{2}}} | | |
link | =yes or =fullpagename |
- Or
Use / description | Default value | |
{{{1}}} | | inherited |
{{{2}}} | | inherited |
{{{3}}} | | |
link | =yes or =页面 |
样例
Markup | Renders as |
---|---|
{{ font color | green | green text }}
|
green text |
{{ font color | blue | do not style text as a link }}
|
do not style text as a link |
{{ font color || yellow | default text in yellow background }}
|
default text in yellow background |
{{ font color | bg=yellow | text = default text in yellow background }}
|
default text in yellow background |
{{ font color | white | black | white with black background }}
|
white with black background |
{{ font color | #ffffff | #000000 | white with black background }} ([[hexadecimal colors]])
|
white with black background (hexadecimal colors) |
Markup | Renders as |
---|---|
{{ font color | white | blue | Wikipedia:Example | link = yes }}
|
Wikipedia:Example |
{{ font color | white | blue | Wikipedia:Example | link = Wikipedia:Sandbox }}
|
Wikipedia:Example |
{{ font color | text = Wikipedia:Example | link = Wikipedia:Sandbox | bg
= blue | fg = white }}
|
Wikipedia:Example |
The |link=
parameter is a good way to colorize wikilinks,
and it is about as much typing as the pipe trick.
Although a wikilink accepts a font color (or other template or markup):
[[Wikipedia:Example|{{font color|white|blue|the Wikipedia:Example page}}]]
- → the Wikipedia:Example page (a font-colored link),
a font color does not accept a wikilink, it creates wikilinks itself with |link=
.
- {{ font color | green | violet | Wikipedia:Example | link=yes }} → Wikipedia:Example (a
|link=
{{ font color }}) - {{ font color | green | violet | the [[Wikipedia:Example]] page}} → the Wikipedia:Example page (Text with [[wikilink brackets]] overrides the designated color)
- {{ font color | green | violet | [[Wikipedia:Exammple]] }} → the Wikipedia:Exammple page (Text with [[wikilink brackets]] overrides the designated color)
For more examples see /testcases. For actual mainspace template usage, here are search links for
- all usage.
- Template:Template usage.
- hastemplate: "font color" prefix:F showing its use in articles whose title begins with the letter "F".
参 见
- MOS:颜色
- 网页颜色
- Help:链接颜色
- {{color}}
- {{background color}}
- {{color contrast ratio}}
- {{Highlight}}
- {{font}}
- {{tq}}
- {{xt}}