跳转到内容

模板:Gallery/doc

本页使用了标题或全文手工转换
维基百科,自由的百科全书

本模板用于建立进阶型图库。如果只是生成普通的图库,建议使用画廊。

本模板会将图片以表格方式由左至右列阵。全域参数|width=和|height=可控制图片大小。每列显示的图片数量会因图片宽度及萤幕宽度(包括浏览器窗口大小等)而不同。

使用方法

[编辑]
{{Gallery
| title        = 
| align        =
| footer       =
| style        =
| state        =
| height       =
| width        =
| perrow       =
| mode         = 
| whitebg      = 
| noborder     =
| captionstyle =
| File:
 | (圖片説明)
 | class1=
 | alt1=
| File:
 | (圖片説明)
 | class2=
 | alt2=
| File:
 | (圖片説明)
 | class3=
 | alt3=
| File:
 | (圖片説明)
 | class4=
 | alt4=
| File:
 | (圖片説明)
 | class5=
 | alt5=
}}

选填参数

[编辑]

适用于整个图库的的参数

|title=:图库的标题
|align=:图片的对齐方式,预设居左,可选居中或居右;填写|state=时将会被忽略
|footer=:在图库的右下角显示的注脚文字
|style=:为整个图库指定CSS样式(参见Help:层叠样式表)
|state=:可折叠图库的预设状态,请填写|state=expanded或|state=collapsed。可折叠图库将会占用页面的全部宽度
|mode=:内嵌画廊的模式。常见使用|mode=packed或|mode=nolines(参见画廊)

适用于图库中所有图片的参数

|noborder=:取消图片的边框,请使用|noborder=yes
|whitebg=:取消图片的白色背景,请使用|whitebg=no
|height=:设定图片显示的高度,预设是180(px)。不需要填写“px”字样
|width=:设定图片显示的宽度,预设是180(px)。不需要填写“px”字样
|perrow=:每排显示的图片数量
|captionstyle=:指定图片说明的CSS样式(参见Help:层叠样式表)

范例

[编辑]
{{Gallery
|title=Cultural depictions of George Washington
|width=160 | height=170 |noborder=yes
|align=center
|footer=Example 1
|File:Federal Hall NYC 27.JPG 
 |Statue of Washington outside [[Federal Hall National Memorial]] in [[New York City]], overlooking [[Wall Street]]
 |alt1=Statue facing a city building with Greek columns and huge U.S. flag
|File:Mount Rushmore2.jpg 
 |Construction of Washington portrait at [[Mount Rushmore]], c. 1932
 |alt2=Profile of stone face on mountainside, with 3 workers.
|File:2006 Quarter Proof.png 
 |Washington is commemorated on a [[Quarter (United States coin)|quarter]].
 |class3=bg-transparent
 |alt3=Shiny silver coin with profile of Washington bust. 
|File:George Washington Presidential $1 Coin obverse.png 
 |Washington on a [[dollar coin (United States)|dollar coin]]
 |class4=bg-transparent
 |alt4=Gold coin with bust of Washington facing slightly left
}}

模板数据

[编辑]

追踪分类

[编辑]

参见

[编辑]