More actions
No edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
max-width:{{{width|150px}}}; | max-width:{{{width|150px}}}; | ||
max-height:{{{height|150px}}}; | max-height:{{{height|150px}}}; | ||
padding: | padding:5px; | ||
border:1px solid #c8ccd1; | border:1px solid #c8ccd1; | ||
background-color:#f8f9fa; | background-color:#f8f9fa; | ||
Line 30: | Line 30: | ||
} | } | ||
ul.gallery.template li.gallerybox div.thumb img{ | ul.gallery.template li.gallerybox div.thumb img{ | ||
max-width:{{#expr:({{#rmatch:{{{width|150px}}}|(\d+)|$1}}- | width:{{#expr:({{#rmatch:{{{width|150px}}}|(\d+)|$1}}-10)}}px; | ||
max-height:{{#expr:({{#rmatch:{{{height|150px}}}|(\d+)|$1}}- | height:{{#expr:({{#rmatch:{{{height|150px}}}|(\d+)|$1}}-10)}}px; | ||
max-width:{{#expr:({{#rmatch:{{{width|150px}}}|(\d+)|$1}}-10)}}px; | |||
max-height:{{#expr:({{#rmatch:{{{height|150px}}}|(\d+)|$1}}-10)}}px; | |||
object-fit:contain;margin:0 auto; | object-fit:contain;margin:0 auto; | ||
} | } | ||
Line 39: | Line 41: | ||
}}}}}} | }}}}}} | ||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> |
Revision as of 18:32, 1 August 2024
标签 <gallery> 的替代品,支持gif动图
使用方法
调用参数
{{gallery|caption=<caption>|width=<width>|height=<height>|perrow=<perrow> |file1|title1 |file2|title2 … |fileN|titleN }}
必填
- file:图片名
选填
- caption:gallery的标题
- width:宽(单位:px)
- height:高(单位:px)
- perrow:每行显示数量
- title:图片提示文字
示例2
你所写的
{{gallery|caption=标题|width=200px|height=100px|perrow=2 |file:Main MPI3508.jpg|文字描述 |file:4.0-HDMI-004.jpg|可以指向[[首页]] |file:4.0-HDMI-004.jpg| }}
显示内容
- 标题
文字描述
可以指向首页