链接需要可以被分辨. 请不要会让读者困惑的方式实现链接,参考 对比, 可访问性 和 导航颜色. |
此Template被引用於約10,000個頁面。 為了避免造成大規模的影響,所有對此Template的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此Template中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
{{Font color}} 你可以这样插入有颜色的文字 红 橙 绿 蓝 靛, 以及 其他。 你也可以通过 background指定背景色。
{{Font color}} 也可以给维基链接上色。 通常 [[ wikilink ]] → wikilink, 不过我们用 {{ font color }} 和 |link =
来创建一个黑紫色的。 → wikilink 你可以通过 |link=
参数创建到达任何页面的链接。
这个模板使用最新的 HTML5 语法,Template:Clarify timeframe/sandbox 为你加入 span 标签: color>...
和 color>...
,以增强页面可读性。
{{Font color}} 有单色和双色版:
两种格式都有一个 |link= 选项,用于给维基链接添加颜色。
[[文字]]
[[页面地址]]
你也可以使用其他参数
你也可以 |fg= 或者 |bg=,但如果你这么用了, 就必须使用 |text=。 (参见 Help:Template#Parameters。)
空格不是问题
.
{{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 |
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 }} | Wiki: Example |
{{ font color | white | blue | Wikipedia:Example | link = Wikipedia:Sandbox }} | Wiki: Example |
{{ font color | text = Wikipedia:Example | link = Wikipedia:Sandbox | bg = blue | fg = white }} | Wiki: 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):
[[Wiki: Example|{{font color|white|blue|the Wikipedia:Example page}}]]
a font color does not accept a wikilink, it creates wikilinks itself with |link=
.
|link=
{{ font color }})For more examples see /testcases. For actual mainspace template usage, here are search links for
上述文档嵌入自Template:Font color/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模板的子页面。 |