Difference between revisions of "Template:CSS image crop"

From Emps-World Wiki
Jump to: navigation, search
(Usage)
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude><div style="
+
== Usage ==
float:left;
+
Just copy the following and fill the id parameter with the correct id:<br>
">
+
<div style="
+
position: absolute;
+
clip: rect(0px,32px,32px,0px);
+
">
+
  
[[File:{{{ImageID/1000}}}.png{{!}}left{{!}}caption]]
+
<nowiki>{{ItemImage|id=4587}}</nowiki>
 
+
<onlyinclude>
</div>
+
  <div class="item-image '{{{caption|hover caption}}}'" style="width: 64px; height: 64px; overflow: hidden; display: inline-block; padding: 0px; margin: 3px; transform: scale(0.7, 0.7);">
</div>  
+
    <div style="position:relative; bottom:{{#expr:{{{oTop|587}}}*64}}px;">
 +
      https://emps-world.net/img/itemicons/{{{ImageID/1000|4}}}-64.png
 +
    </div>
 +
  </div>
 
</onlyinclude>
 
</onlyinclude>
<nowiki>clip:rect(0px,100px,100px,0px);</nowiki> for a 100x100 image to totally show, so for our atlasses that would be:<br>
 
<nowiki>clip:rect(0px,32px,32000px,0px);</nowiki>
 

Latest revision as of 15:51, 8 September 2021

Usage

Just copy the following and fill the id parameter with the correct id:

{{ItemImage|id=4587}}

      4-64.png