Please remember that WiKirby contains spoilers, which you read at your own risk! See our general disclaimer for details.

Template:ImCap: Difference between revisions

From WiKirby, your independent source of Kirby knowledge.
Jump to navigationJump to search
*>Neo
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><div class="thumb {{#switch: {{{align}}}|right = tright|left = tleft }}">
<includeonly><div class="thumb t{{{align|right}}}">
<div class="thumbinner" style="-moz-background clip:none;background: none !important; border: none !important;width: {{{size|}}};">[[{{{image|}}}|{{{size|}}}]]
<div class="thumbinner" style="-moz-background clip:none;background: none !important; border: none !important;width: {{#if: {{{captionwidth|}}}|{{{captionwidth|}}}|{{{size|}}} }}; {{#if:{{{sprite|}}}|image-rendering:pixelated;}}}">[[{{{image|}}}|{{{size|}}}]]
<div class="thumbcaption" style="background: pink; margin-top: 2px; border: 1px solid black; {{#switch: {{{captionalign }}}|right = text-align: right;|center = text-align: center; }}">{{{caption}}}</div></div></div></includeonly><noinclude>
<div class="thumbcaption" style="background: pink; margin-top: 2px; border: 1px solid black; text-align: {{{captionalign|center}}};">{{{caption|}}}</div></div></div></includeonly>
<noinclude>
{{doc}}
{{doc}}
[[Category:Formatting Templates|{{PAGENAME}}]]
[[Category:Formatting templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Latest revision as of 00:33, 23 October 2023


Usage[edit]

This template allows you to add a caption to an image without creating a frame around it. This is used for transparent images.

Usage:

{{ImCap
|image=        the image
|size=         the width of the image (in pixels)
|align=        alignment (optional, defaults to right)
|caption=      the caption
|captionalign= caption alignment relative to image (optional, defaults to center)
|captionwidth= the width of the caption (in pixels) (optional)
|sprite=       fill this in if the image is a sprite getting enlarged (optional)
}}

Note that "captionwidth" should be greater than or equal to "size" when used, or the image may get cut off.

Example[edit]

WiKirby.png
It's a Wiki. About Kirby.


{{ImCap
|image=File:WiKirby2.png
|size=109px
|align=right
|caption=It's a Wiki. About Kirby.
|captionalign=center
|captionwidth=175px
}}