打开/关闭菜单
1683
2.2万
6527
11.7万
舰R百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

微件: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>
    {* Required attribute *}
这个微件是<nowiki><img></nowiki>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<nowiki><img></nowiki>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。
    {if $src}src="{$src}"{/if}


    {* Core attributes *}
使用:
    {if $alt}alt="{$alt}"{/if}
<code><nowiki>
    {if $width}width="{$width}"{/if}
{{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}}
    {if $height}height="{$height}"{/if}
</nowiki></code>


    {* Loading behavior *}
所有可用参数:
    {if $loading}loading="{$loading}"{/if}
* src
    {if $decoding}decoding="{$decoding}"{/if}
* alt
    {if $fetchpriority}fetchpriority="{$fetchpriority}"{/if}
* width
* height
* style
* class
* loading
* decoding
* fetchpriority
* sizes
* srcset
* crossorigin
* referrerpolicy
</noinclude>


     {* Responsive image attributes *}
<includeonly>
     {if $sizes}sizes="{$sizes}"{/if}
<img
    {if $srcset}srcset="{$srcset}"{/if}
     <!--{* Required attribute *}-->
     <!--{if !empty($src)}-->src="<!--{$src|escape:'html'}-->"<!--{/if}-->


     {* Security and privacy *}
     <!--{* Core attributes *}-->
     {if $crossorigin}crossorigin="{$crossorigin}"{/if}
     <!--{if !empty($alt)}-->alt="<!--{$alt|escape:'html'}-->"<!--{/if}-->
     {if $referrerpolicy}referrerpolicy="{$referrerpolicy}"{/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}-->
      
      
     {* Image maps *}
     <!--{* Loading behavior *}-->
     {if $usemap}usemap="#{$usemap}"{/if}
     <!--{if !empty($loading)}-->loading="<!--{$loading|escape:'html'}-->"<!--{/if}-->
     {if $ismap}ismap{/if}
     <!--{if !empty($decoding)}-->decoding="<!--{$decoding|escape:'html'}-->"<!--{/if}-->
 
     <!--{if !empty($fetchpriority)}-->fetchpriority="<!--{$fetchpriority|escape:'html'}-->"<!--{/if}-->
    {* Performance monitoring *}
    {if $elementtiming}elementtiming="{$elementtiming}"{/if}
 
     {* Attribution reporting - Experimental *}
    {if $attributionsrc}attributionsrc="{$attributionsrc}"{/if}
 
    {* Standard HTML attributes *}
    {if $id}id="{$id}"{/if}
    {if $class}class="{$class}"{/if}
    {if $style}style="{$style}"{/if}
    {if $title}title="{$title}"{/if}


     {* Accessibility *}
     <!--{* Responsive image attributes *}-->
     {if $role}role="{$role}"{/if}
     <!--{if !empty($sizes)}-->sizes="<!--{$sizes|escape:'html'}-->"<!--{/if}-->
     {if $aria}
     <!--{if !empty($srcset)}-->srcset="<!--{$srcset|escape:'html'}-->"<!--{/if}-->
        {foreach $aria as $key => $value}
            aria-{$key}="{$value}"
        {/foreach}
    {/if}


     {* Data attributes *}
     <!--{* Security and privacy *}-->
     {if $data_attributes}
     <!--{if !empty($crossorigin)}-->crossorigin="<!--{$crossorigin|escape:'html'}-->"<!--{/if}-->
        {foreach $data_attributes as $key => $value}
    <!--{if !empty($referrerpolicy)}-->referrerpolicy="<!--{$referrerpolicy|escape:'html'}-->"<!--{/if}-->
            data-{$key}="{$value}"
        {/foreach}
    {/if}
/>
/>
</includeonly>