font Color

文档图示 模板文档

用途

{{Font color}} 你可以这样插入有颜色的文字 绿 , 以及 其他。 你也可以通过 background指定背景色。

{{Font color}} 也可以给维基链接上色。 通常 [[ wikilink ]] → wikilink, 不过我们用 {{ font color }} 和 |link = 来创建一个黑紫色的。 →    wikilink    你可以通过 |link= 参数创建到达任何页面的链接。

这个模板使用最新的 HTML5 语法,Template:Clarify timeframe/sandbox 为你加入 span 标签: color>...color>...,以增强页面可读性。

用法

{{Font color}} 有单色和双色版:

    {{font color | 文字颜色 | 文字 }}
    {{font color | 文字颜色 | 背景颜色 | 文字 }}.

两种格式都有一个 |link= 选项,用于给维基链接添加颜色。

    |link=yes[[文字]]
    |link=fullpagename[[页面地址]]

你也可以使用其他参数

    {{font color | fg=color | text=text }}
    {{font color | fg=文字颜色 | bg=背景颜色 | text=文字 }}

你也可以 |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
    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 }} 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):

a font color does not accept a wikilink, it creates wikilinks itself with |link=.

  • font Color {{ font color | green | violet | Wikipedia:Example | link=yes }} → Wiki: Example (a |link= {{ font color }})
  • ☒N{{ font color | green | violet | the [[Wikipedia:Example]] page}} → the Wiki: Example page (Text with [[wikilink brackets]] overrides the designated color)
  • ☒N{{ 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

参见

Tags:

🔥 Trending searches on Wiki 中文:

三十而已美麗人生 (台視電視劇)IZ*ONE2024年中華民國總統選舉Fantasy Boys林奕含IVE (組合)九一一袭击事件毒梟聖徒薛紀綱假面的女王马伯骞隆宸翰漫长的季节馬志威楊謹華邱瓈寬堡壘 (電視劇)吉高由里子和平歸來馬時亨浪漫醫生金師傅2浪漫醫生金師傅Rei大熊猫NBA季后赛呂思緯乘风2023詹懷雲吴磊謝沛恩彭德怀【我推的孩子】俄乌战争胡瑋杰金秀賢 (男演員)曾志偉岳飞中国共产党知否?知否?应是绿肥红瘦李一桐格鲁吉亚潘慧如玉子妍王玉雯申東旭柯有倫進擊的巨人 (動畫)藍甯彤春闺梦里人毛泽东苍兰诀江泽民055型导弹驱逐舰中越战争IU (歌手)走進你的時間裡包偉銘胡春华蔡潔姜泰伍陳建隆獻給國王的無名指星際異攻隊3文俊輝模範計程車楊丞琳乘风破浪的姐姐 (第二季)宫崎骏潤娥乘风破浪 (第三季)迷城 (電影)华晨宇柯佳嬿Jennie (韓國歌手)三年困难时期柳秀榮黃金週 (中國)于文文🡆 More