跳转到内容

模板:Element color/doc

维基教科书,自由的教学读本

本模板用于统一各种元素周期表的配色及格式。
此模板返回元素的图例十二进制色码,用于HTML编码,如:

  • {{Element color|Alkali metal}}#ff6666
  • 有些颜色作为字体前景色之用,如:
  • {{Element color|gas}}#cb0000
  • 有些返回值为完整的边框设定,如:
  • {{Element color|Synthetic}}2px dotted #6e6e8e

驻:事实上真正返回的代码类似 #ffc0c0; (# 为 "#"). 如此任何HTML页面才不会将#视为编号用符号。

字体前景色选项

[编辑]
XML Example

attribute value

用法: style="color:{{element color|gas}};"

物质相态(前景色)

[编辑]

方格边框选项

[编辑]
XML Example

attribute value

用法:style="border:{{element color|synthetic}};"

发现方法 (边框)

[编辑]

背景色选项

[编辑]
XML Example

attribute value

用法: style="background:{{element color|alkali metals}};"

金属–非金属分类

[编辑]

Standard atomic weight

[编辑]
msi = most stable isotope

发现时期

[编辑]

例子: {{Periodic table (discovery periods)}}

Blocks

[编辑]

In period 8, theoretical elements:

Numbers

[编辑]

Used in: Valence (chemistry)#Maximum valences of the elements These colors correspond to the Alkali metal–noble gases range

Metalloid cite classes

[编辑]

See Template:Periodic table (list of metalloid lists)

Setting a default color

[编辑]
|1=not a color name |default=#aabbccTemplate:Element color/secondary (use # not #)
|1=not a color name |default=thistleTemplate:Element color/secondary


"Unknown" variants

[编辑]

Usable in mainspace

Wikipedia article quality

[编辑]

Used in: Wikipedia:WikiProject Elements/Articles/Periodic Table by Quality

Wikipedia article importance

[编辑]

Color names

[编辑]

Table background

[编辑]

Template:Element color/table/overview

Colors hardcoded

[编辑]

The same colors, with the same key, may be hardcoded in templates and pages:


Template data

[编辑]
这是用于新版可视化编辑器及其他工具的模板数据文档。

Element color模板数据

This template returns an RGB color number, for usage in css style setting (style="background:#ab23a6"). For certain input, a css fontcolor or border style is returned.

模板参数

参数描述类型状态
Color class name1

Predefined class name to return its legend color

示例值
alkali metal
字符串必需

Deprecated and experimental parameters

[编辑]

Those not for mainspace are kept in {{Element color/secondary}}

See also

[编辑]