<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://attuproject.org/wiki?action=history&amp;feed=atom&amp;title=Template%3ACSS_image_crop%2Fdoc</id>
	<title>Template:CSS image crop/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://attuproject.org/wiki?action=history&amp;feed=atom&amp;title=Template%3ACSS_image_crop%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://attuproject.org/wiki?title=Template:CSS_image_crop/doc&amp;action=history"/>
	<updated>2026-10-15T10:20:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.6</generator>
	<entry>
		<id>https://attuproject.org/wiki?title=Template:CSS_image_crop/doc&amp;diff=30961&amp;oldid=prev</id>
		<title>w&gt;Jonesey95: rm old note; left and right work fine</title>
		<link rel="alternate" type="text/html" href="https://attuproject.org/wiki?title=Template:CSS_image_crop/doc&amp;diff=30961&amp;oldid=prev"/>
		<updated>2026-05-27T13:37:29Z</updated>

		<summary type="html">&lt;p&gt;rm old note; left and right work fine&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{High-use|demo={{ROOTPAGENAME}}}}&lt;br /&gt;
&lt;br /&gt;
{{hatnote|See also [[Template:Easy CSS image crop]], which simplifies the interface for this template a bit.}}&lt;br /&gt;
&lt;br /&gt;
{{tl|{{BASEPAGENAME}}}} creates a crop of an image inline for previewing the look and feel of a page, or for linking to full images when a slight crop is preferred in an article, but the full image is more encyclopaedic in general. Where only a small section of the image is used after the crop, it&amp;#039;s best to upload the crop as a new file, to avoid sending the extra image data to users. &lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{CSS image crop&lt;br /&gt;
|Image         = The Name of the image file, or may accept {{Annotated image}}.&lt;br /&gt;
|bSize         = The Base Image width in pixels (the image we are cropping on)&lt;br /&gt;
|cWidth        = Crop Image Width in pixels&lt;br /&gt;
|cHeight       = Crop image Height in pixels&lt;br /&gt;
|oTop          = Offset Top in pixels, optional and defaults to 0 when omitted&lt;br /&gt;
|oLeft         = Offset Left in pixels, optional and defaults to 0 when omitted&lt;br /&gt;
|Location      = &amp;#039;right&amp;#039;, &amp;#039;left&amp;#039;, &amp;#039;center&amp;#039; or &amp;#039;none&amp;#039;. Determines placement of the image on the page&lt;br /&gt;
                 Defaults to &amp;#039;right&amp;#039; when description is provided (as is default for thumb images)&lt;br /&gt;
                 When description is blank, location on left (as is default for non-thumbs)&lt;br /&gt;
|Description   = Description (will render out using thumbnail class)&lt;br /&gt;
|Link          = Name of an article to be linked by clicking on the image (omit unless there is a&lt;br /&gt;
                 good reason to link to an article instead of the image).&lt;br /&gt;
|Alt           = The alt text for the image.&lt;br /&gt;
|Page          = The page of the file, if there are multiple pages (such as pdf files).&lt;br /&gt;
|Class         = The MediaWiki class, if needed. Useful for adding skin-invert for dark mode.&lt;br /&gt;
|magnify-link  = The image to be linked by the magnify icon (Use if the Image parameter is set to&lt;br /&gt;
                 {{Annotated image}} or the Link parameter leads to something other than the image).&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Create a cropped image of a single water drop: &lt;br /&gt;
&lt;br /&gt;
[[File:Dew on grass Luc Viatour.jpg|thumb|400px|left|Thumbnail of the &amp;#039;&amp;#039;&amp;#039;original file&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: left; width: 120px; margin: 180px 0 0 30px;&amp;quot;&amp;gt;&lt;br /&gt;
{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: left; width: 300px; margin-top: 150px; font-size: 0.95em;&amp;quot;&amp;gt;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Offset&amp;#039;&amp;#039;&amp;#039;: &amp;lt;code&amp;gt;oTop&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oLeft&amp;lt;/code&amp;gt; define the upper left corner of the cropped image&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Crop&amp;#039;&amp;#039;&amp;#039;: &amp;lt;code&amp;gt;cWidth&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cHeight&amp;lt;/code&amp;gt; define the size of the cropped image&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Base Size&amp;#039;&amp;#039;&amp;#039;: Offset and Crop are calculated as if the original file had the width &amp;lt;code&amp;gt;bSize&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the cropped image can have a caption-text and be positioned on the page:&lt;br /&gt;
* &amp;lt;code&amp;gt;Location=&amp;lt;/code&amp;gt; to position (&amp;#039;&amp;#039;center, right, left, none&amp;#039;&amp;#039;)&lt;br /&gt;
* &amp;lt;code&amp;gt;Description=&amp;lt;/code&amp;gt; to add a text to the caption&lt;br /&gt;
{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
|Location = center&lt;br /&gt;
|Description = A drop of dew on grass (focus on the drop)&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
|Location = center&lt;br /&gt;
|Description = A drop of dew on grass (focus on the drop)&lt;br /&gt;
}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Groups of cropped images can be arranged in an [[Template:Image frame|image frame]]:&lt;br /&gt;
{{Image frame|align=center|border=no|caption=Cropped images in a frame|content=&lt;br /&gt;
{{stack&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Aaron_Burden_2017-05-03_(Unsplash).jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew on Lemon Grass - Shola Gardens - Kotagiri.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
{{stack&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew and grass - Flickr - Stiller Beobachter.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Image frame|align=center|border=no|caption=Cropped images in a frame|content=&lt;br /&gt;
{{stack&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Aaron_Burden_2017-05-03_(Unsplash).jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew on Lemon Grass - Shola Gardens - Kotagiri.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
{{stack&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew on grass Luc Viatour.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
|{{CSS image crop&lt;br /&gt;
|Image = Dew and grass - Flickr - Stiller Beobachter.jpg&lt;br /&gt;
|bSize = 400&lt;br /&gt;
|cWidth = 100&lt;br /&gt;
|cHeight = 100&lt;br /&gt;
|oTop = 180&lt;br /&gt;
|oLeft = 60&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tracking categories==&lt;br /&gt;
* {{Category link with count|CSS image crop using invalid parameters}} - Uses of this template with invalid parameters&lt;br /&gt;
&lt;br /&gt;
==Scripts==&lt;br /&gt;
The user script [[User:BrandonXLF/CSSImageCrop]] can be used to generate code to use this template with an interactive UI.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* {{tl|Easy CSS image crop}}, which simplifies the interface for this template a bit&lt;br /&gt;
* {{tl|Show SVG}}, which display SVG files from source, including animations&lt;br /&gt;
* {{tl|Annotated image}}&lt;br /&gt;
** [[Template:Annotated image/doc/Samples#Cropping an image|with empty &amp;quot;annotations&amp;quot; parameter]]&lt;br /&gt;
** {{tl|IrinotecanPathway WP229}} (as used in article [[Multidrug resistance-associated protein 2]]), an example of how CSS Image Crop can combine with Annotated Image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other|&lt;br /&gt;
| &amp;lt;!-- CATEGORIES BELOW THIS LINE, PLEASE: --&amp;gt;&lt;br /&gt;
[[Category:Image formatting and function templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>w&gt;Jonesey95</name></author>
	</entry>
</feed>