Template:CSS image crop: Difference between revisions
From WikiMD's Wellness Encyclopedia
en>Pppery Per request on talk |
m 1 revision imported |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{#if:{{{Image|}}}| | {{#if:{{{Image|}}}|<div class="{{#if:{{{Description|}}}|thumb <!-- | ||
-->{{#switch:{{{Location|}}} | |||
-->{{#switch:{{{Location| | | none | tnone = tnone | ||
| none | tnone | |||
| left | tleft = tleft | | left | tleft = tleft | ||
| right | tright = tright | | right | tright = tright | ||
| center = center | |||
| #default = tright }}|<!-- if no description: | | #default = tright }}|<!-- if no description: | ||
-->{{#switch:{{{Location| | -->{{#switch:{{{Location|}}} | ||
| none = floatnone | | none = floatnone | ||
| left = floatleft | | left = floatleft | ||
| right = floatright}}}}"> | | right = floatright | ||
| center = center }}}}"> | |||
{{#if:{{{Description|}}}|<div class="thumbinner" style="width: {{#expr:{{{cWidth}}}+2}}px;">}} | {{#if:{{{Description|}}}|<div class="thumbinner" style="width: {{#expr:{{{cWidth}}}+2}}px;">}} | ||
<div {{#if:{{{Description|}}}|class="thumbimage"}} style="width: {{{cWidth}}}px; height: {{{cHeight}}}px; overflow: hidden;"> | <div {{#if:{{{Description|}}}|class="thumbimage"}} style="width: {{{cWidth}}}px; height: {{{cHeight}}}px; overflow: hidden;"> | ||
<div style="position: relative; top: -{{{oTop|0}}}px; left: -{{{oLeft|0}}}px; width: {{{bSize}}}px"><!-- | <div style="position: relative; top: -{{{oTop|0}}}px; left: -{{{oLeft|0}}}px; width: {{{bSize}}}px"><!-- | ||
--><div class="noresize">[[File:{{{Image | --><div class="noresize">[[File:{{{Image}}}|{{{bSize}}}px|alt={{{Alt|{{{Description|{{{Image}}}}}}}}}{{#if:{{{Link|}}}|{{!}}link={{{Link}}}}}{{#if:{{{Page|}}}|{{!}}page={{{Page}}}}}]]</div><!-- | ||
--></div> | --></div> | ||
{{#if:{{{Description|}}}|</div> | {{#if:{{{Description|}}}|</div> | ||
| Line 21: | Line 21: | ||
</div>}} | </div>}} | ||
</div> | </div> | ||
</div> | </div>{{#ifeq:1|{{ifnumber|{{{cWidth|}}}{{{cHeight|}}}{{{oTop|}}}{{{oLeft|}}}{{{bSize|}}}}}||[[Category:CSS image crop using invalid parameters]]}}}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
{{no-index-template}} | |||
Latest revision as of 18:14, 8 March 2025