模板:Wide image:修订间差异
| [未复核版本] | [已复核版本] |
无编辑摘要 |
ZihuananaBot(留言 | 贡献) 新增 align=center 参数:图片水平居中(尺寸不变) |
||
| (未显示1个用户的3个中间版本) | |||
| 第5行: | 第5行: | ||
|#default=tnone" style="margin-left: auto; margin-right:auto; overflow:hidden; | |#default=tnone" style="margin-left: auto; margin-right:auto; overflow:hidden; | ||
}} width:{{{4|auto}}}; max-width:{{#ifeq:{{{border|}}}|no|{{#expr:{{str find|{{{2}}}|px}} -1}}}} + 8}}px}};"> | }} width:{{{4|auto}}}; max-width:{{#ifeq:{{{border|}}}|no|{{#expr:{{str find|{{{2}}}|px}} -1}}}} + 8}}px}};"> | ||
{{#ifeq:{{{border|}}}|no||<div class="thumbinner">}}<div class="noresize overflowbugx" style="overflow:auto;{{#ifeq:{{{dir|}}}|rtl|direction:rtl;}}">[[File:{{{1}}}|{{{2}}} | {{#ifeq:{{{border|}}}|no||<div class="thumbinner">}}<div class="noresize overflowbugx" style="overflow:auto;{{#ifeq:{{{align|}}}|center|width:fit-content;max-width:100%;margin-left:auto;margin-right:auto;}}{{#ifeq:{{{dir|}}}|rtl|direction:rtl;}}">[[File:{{{1}}}|{{{2}}}|{{#switch:{{{3}}} | ||
|thumb | |thumb | ||
|thumbnail | |thumbnail | ||
| 第17行: | 第17行: | ||
== 使用方式 == | == 使用方式 == | ||
:<code><nowiki>{{</nowiki>Wide image|圖像檔名|圖像展示寬度|圖像說明|模板寬度|模板位置 | :<code><nowiki>{{</nowiki>Wide image|圖像檔名|圖像展示寬度|圖像說明|模板寬度|模板位置<nowiki>}}</nowiki></code> | ||
*<code>图像文件名</code>为必填,不需前缀<code><nowiki>File:</nowiki></code>。 | *<code>图像文件名</code>为必填,不需前缀<code><nowiki>File:</nowiki></code>。 | ||
| 第23行: | 第23行: | ||
*<code>图像说明</code>参数为选填,若填入图像说明则会自动加入缩图外框。如果图像说明中需要使用「等于符号」(=),请将使用 <code>|图像说明</code>替换成<code>|3=图像说明</code>。 | *<code>图像说明</code>参数为选填,若填入图像说明则会自动加入缩图外框。如果图像说明中需要使用「等于符号」(=),请将使用 <code>|图像说明</code>替换成<code>|3=图像说明</code>。 | ||
*<code>模板宽度</code>参数为选填,如果数值单位是像素,请在后方加入「px」;若数值是百分比,请在最后加入「%」。 | *<code>模板宽度</code>参数为选填,如果数值单位是像素,请在后方加入「px」;若数值是百分比,请在最后加入「%」。 | ||
*<code>align=center</code> 为选填,让图片在容器内水平居中(尺寸不变;窄屏时仍可从左侧滚动查看) | |||
*<code>模板位置</code>参数也是选填,但要使用此参数时需同时指定「模板宽度」参数。可指定模板在页面上对齐的方向,数值可填入<code>right</code>或<code>left</code>。 | *<code>模板位置</code>参数也是选填,但要使用此参数时需同时指定「模板宽度」参数。可指定模板在页面上对齐的方向,数值可填入<code>right</code>或<code>left</code>。 | ||
*<code>辅助说明文字</code>是让视觉障碍的读者能了解图片内容的文字说明。 | *<code>辅助说明文字</code>是让视觉障碍的读者能了解图片内容的文字说明。 | ||
| 第38行: | 第39行: | ||
"label": "图片名称", | "label": "图片名称", | ||
"description": "需要显示的图片", | "description": "需要显示的图片", | ||
"example": "例如images.JPG", | |||
"type": "string", | "type": "string", | ||
"required": true | "required": true | ||
| 第44行: | 第46行: | ||
"label": "展示宽度", | "label": "展示宽度", | ||
"description": "设置图像在页面显示的宽度,单位为px", | "description": "设置图像在页面显示的宽度,单位为px", | ||
"example": "例如800px", | |||
"type": "string", | "type": "string", | ||
"required": true | "required": true | ||
| 第63行: | 第66行: | ||
"description": "可指定模板在页面上对齐的方向,数值可填入right、left或center,需同时指定“模板宽度”参数", | "description": "可指定模板在页面上对齐的方向,数值可填入right、left或center,需同时指定“模板宽度”参数", | ||
"default": "center", | "default": "center", | ||
"type": "string", | "type": "string", | ||
"required": false | "required": false | ||