For faster navigation, this Iframe is preloading the Wikiwand page for 模板:Image label.

模板:Image label

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

用法

可参考下方的示例,改编自en:Template:Australia Labelled Map

((Image label begin|image=Australia location map recolored.png
                   |alt=澳大利亚地图。西澳大利亚州位于西部,首府为珀斯;北领地位于北部中心,首府为达尔文;昆士兰州位于东北部,首府为布里斯班;南澳大利亚州位于南部,首府为阿德莱德;新南威尔士州位于东南部北部,首府为悉尼;维多利亚州位于最东南部,首府为墨尔本。塔斯马尼亚州,首府霍巴特,位于维多利亚州的海岸边,横跨巴斯海峡。西部和西北部是印度洋,东部是南太平洋,南部是南大洋,东南是塔斯曼海。南部的大澳大利亚湾和北部的卡彭塔利亚湾是主要海湾。帝汶海和阿拉弗拉海位于北海岸外,大堡礁保护着东北海岸免受珊瑚海的侵袭。
                   |width=(({width|))}
                   |font-size=85%))
((Image label|scale=(({width|))}|x=0.26 |y=0.345 |text=[[西澳大利亚州]]))
((Image label|scale=(({width|))}|x=0.46 |y=0.20  |text=[[北领地]]))
((Image label|scale=(({width|))}|x=0.505|y=0.4025|text=[[南澳大利亚州]]))
...
((Image label end))

参数

width/scale

单位为像素,默认为400。

如果给((image label begin))填入了|width=值,则((image label))中的|scale=值必须与之相同,否则在图片尺寸调整时,标签会出现错位。在模板中使用时,最简单的方法是通过相同的参数名称来确保这一点,可参考上方的示例。

x/y

x值代表标签到左边的距离,与图片顶边长度的比值;y值代表标签到上边的距离,与图片顶边长度的比值。x值总是在0和1之间。对于正方形图像,y值也在0和1之间。

例如,在正方形图像中:

  • |x=0|y=0会将标签的左上角放在图像的左上角
  • |x=0|y=1会将标签的左上角放在图像的左下角
  • |x=1|y=0会将标签的左上角放在图像的右上角
  • |x=0.5|y=0.5会将标签的左上角放在图像的右上角

image

图像的名称,不用加“File:”前缀。

text

标签显示的文字,可以加入内链等。

float

悬浮方式,有四种选项:

  • |float=none – 默认
  • |float=center – 页面居中
  • |float=left –页面左侧
  • |float=right – 页面右侧

font-size

可选。用于指定标签的字体大小。例如,|font-size=85%会以较小的字体显示标签。如果省略,字体大小将从周围内容中继承。

|font-size=也可以在每个((image label))上单独设置,以调整该标签的字体大小。

font-strech

仅用于((image label))等。用于改变标签的文字宽窄,适用于西文字体。有效的值包括 normalsemi-condensedcondensedextra-condensedultra-condensedsemi-expandedexpandedextra-expanded 或者 ultra-expanded,也可以是百分数,例如,|font-stretch=75%

text-align

可选。如果给定,影响有换行符(<br/>)的标签内的逐行对齐。如果省略,默认文本对齐方式为居中。

link

指定图片应该链接到哪里。若填入File:(默认),图像将链接到其文件页面。如果为空值,图像不链接到页面,这适合于纯粹的装饰性图像。

alt

指定图片的“alt”属性所使用的文本,参见Wikipedia:图像的替代文字。如果|link=是空值,|alt=也应该为空值;如果|link=File:或者没有使用|link=参数,|alt=应该描述图片;如果|link=指向其他页面,|alt=应该描述如果点击图片会发生什么。

caption

图片的说明文字。

模板组合

工具

参见

{{bottomLinkPreText}} {{bottomLinkText}}
模板:Image label
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?