模板:Gallery
| 此模板被引用于约5,000个页面。 为了避免造成大规模的影响,所有对此模板的编辑应先于沙盒、测试样例或您的沙盒上测试。实施修改前,建议先在讨论页发起讨论。 模板引用数量会自动更新。 |
| 此模板使用Lua语言: |
| 本模板使用以下模板样式: |
本模板用于建立进阶型图库。如果只是生成普通的图库,建议使用画廊。
本模板会将图片以表格方式由左至右列阵。全域参数|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
}}
-
Statue of Washington outside Federal Hall National Memorial in New York City, overlooking Wall Street
-
Construction of Washington portrait at Mount Rushmore, c. 1932
-
Washington is commemorated on a quarter.
-
Washington on a dollar coin
模板数据
模板数据
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
将此模板放置在条目或用户页上,即可在该页面上创建带标题的图库。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
追踪分类
- Category:使用Gallery不含媒体命名空间前缀的页面(549)
- Category:使用Gallery含有captionstyle参数的页面(2)
- Category:使用Gallery含有未知参数的页面(5)
- Category:使用Gallery可能存在替代文字不符情况的页面(5)
参见
- Help:Gallery
- {{Cleanup gallery}},以标记非百科图像的图库
- {{Image array}}
- {{Multiple image}}
- {{Photomontage}}
- {{Image frame}}
- {{Gallery items}},将图库样式布局应用于任意内容区段(如模板输出)
- {{Stack}},图像等可以在右侧堆叠,避免间距和浮动问题