User:Purple Wrench/crop-me-do

From Homestar Runner Wiki

< User:Purple Wrench(Difference between revisions)
Jump to: navigation, search
(a handy cropping template)
m (newline)
 
Line 8: Line 8:
: <code>left</code> and <code>top</code> - the offset of the result, in pixels. Must be positive. Defaults to the origin.
: <code>left</code> and <code>top</code> - the offset of the result, in pixels. Must be positive. Defaults to the origin.
: <code>image</code> - the image to be cropped.
: <code>image</code> - the image to be cropped.
-
</noinclude>
+
</noinclude><includeonly><div style="display: {{{display|inline-block}}}; overflow:hidden; width: {{{width}}}px; height: {{{height}}}px; position: relative"><div style="left: -{{{left|0}}}px; top: -{{{top|0}}}px; position: absolute;">{{{image}}}</div></div></includeonly>
-
<includeonly><div style="display: {{{display|inline-block}}}; overflow:hidden; width: {{{width}}}px; height: {{{height}}}px; position: relative"><div style="left: -{{{left|0}}}px; top: -{{{top|0}}}px; position: absolute;">{{{image}}}</div></div></includeonly>
+

Current revision as of 00:38, 22 August 2021

A handy cropping template.


Parameters:

display - the CSS display value (default inline-block)
width and height - the width and height of the result, in pixels. Must be positive.
left and top - the offset of the result, in pixels. Must be positive. Defaults to the origin.
image - the image to be cropped.
Personal tools