Template:CSS image crop
![]() | This template is used on approximately 5,700 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
See also Template:Easy CSS image crop, which simplifies the interface for this template a bit.
{{CSS image crop}} 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's best to upload the crop as a new file, to avoid sending the extra image data to users.
Note: There was a previous glitch for which some people had to use "tleft" "tright" etc. as a workaround because "left" and "right" did not work. As a result, to avoid having to fix all those pages that used the workaround, the template has been designed to function properly regardless of whether tright or right is used. See template talk for details.
Usage
<syntaxhighlight lang="wikitext">
<div class="thumbinner" style="width: Expression error: Unrecognized word "crop".px;">
</syntaxhighlight>
Examples
Create a cropped image of a single water drop:

- Offset:
oTop
andoLeft
define the upper left corner of the cropped image - Crop:
cWidth
andcHeight
define the size of the cropped image - Base Size: Offset and Crop are calculated as if the original file had the width
bSize
In addition, the cropped image can have a caption-text and be positioned on the page:
Location=
to position (center, right, left, none)Description=
to add a text to the caption
Groups of cropped images can be arranged in an image frame:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Tracking categories
- Category:CSS image crop using invalid parameters (4) - Uses of this template with invalid parameters
Scripts
The user script User:BrandonXLF/CSSImageCrop can be used to generate code to use this template with an interactive UI.
See also
- {{Annotated image}}
- with empty "annotations" parameter
- {{IrinotecanPathway WP229}} (as used in article Multidrug resistance-associated protein 2), an example of how CSS Image Crop can combine with Annotated Image.