微件:ImgTag:修订间差异
舰R百科,玩家自由编辑的战舰少女R百科
更多操作
创建页面,内容为“<img {* Required attribute *} {if $src}src="{$src}"{/if} {* Core attributes *} {if $alt}alt="{$alt}"{/if} {if $width}width="{$width}"{/if} {if $height}height="{$height}"{/if} {* Loading behavior *} {if $loading}loading="{$loading}"{/if} {if $decoding}decoding="{$decoding}"{/if} {if $fetchpriority}fetchpriority="{$fetchpriority}"{/if} {* Responsive image attributes *} {if $sizes}sizes="{$sizes}"{/if} {if $sr…” |
无编辑摘要 |
||
| (未显示同一用户的37个中间版本) | |||
| 第1行: | 第1行: | ||
<img | <noinclude> | ||
这个微件是<nowiki><img></nowiki>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<nowiki><img></nowiki>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。 | |||
使用: | |||
<code><nowiki> | |||
{{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}} | |||
</nowiki></code> | |||
所有可用参数: | |||
* src | |||
* alt | |||
* width | |||
* height | |||
* style | |||
* class | |||
* loading | |||
* decoding | |||
* fetchpriority | |||
* sizes | |||
* srcset | |||
* crossorigin | |||
* referrerpolicy | |||
</noinclude> | |||
{* | <includeonly> | ||
{if $ | <img | ||
<!--{* Required attribute *}--> | |||
<!--{if !empty($src)}-->src="<!--{$src|escape:'html'}-->"<!--{/if}--> | |||
{* | <!--{* Core attributes *}--> | ||
{if $ | <!--{if !empty($alt)}-->alt="<!--{$alt|escape:'html'}-->"<!--{/if}--> | ||
{if $ | <!--{if !empty($width)}-->width="<!--{$width|escape:'html'}-->"<!--{/if}--> | ||
<!--{if !empty($height)}-->height="<!--{$height|escape:'html'}-->"<!--{/if}--> | |||
<!--{if !empty($style)}-->style="<!--{$style|escape:'html'}-->"<!--{/if}--> | |||
<!--{if !empty($class)}-->class="<!--{$class|escape:'html'}-->"<!--{/if}--> | |||
{* | <!--{* Loading behavior *}--> | ||
{if $ | <!--{if !empty($loading)}-->loading="<!--{$loading|escape:'html'}-->"<!--{/if}--> | ||
{if $ | <!--{if !empty($decoding)}-->decoding="<!--{$decoding|escape:'html'}-->"<!--{/if}--> | ||
<!--{if !empty($fetchpriority)}-->fetchpriority="<!--{$fetchpriority|escape:'html'}-->"<!--{/if}--> | |||
{* | <!--{* Responsive image attributes *}--> | ||
{if $ | <!--{if !empty($sizes)}-->sizes="<!--{$sizes|escape:'html'}-->"<!--{/if}--> | ||
{if $ | <!--{if !empty($srcset)}-->srcset="<!--{$srcset|escape:'html'}-->"<!--{/if}--> | ||
{* | <!--{* Security and privacy *}--> | ||
{if $ | <!--{if !empty($crossorigin)}-->crossorigin="<!--{$crossorigin|escape:'html'}-->"<!--{/if}--> | ||
<!--{if !empty($referrerpolicy)}-->referrerpolicy="<!--{$referrerpolicy|escape:'html'}-->"<!--{/if}--> | |||
/> | /> | ||
</includeonly> | |||