Difference between revisions of "Template:Image"

From Wikimedia District of Columbia
Jump to navigation Jump to search
(Small margin between image and caption)
(Working)
Line 1: Line 1:
 
<div class="banner-image" style="max-width:{{{width|400px}}};{{#ifeq: {{{padding|}}}|no|| padding-left:1.5em;}}">
 
<div class="banner-image" style="max-width:{{{width|400px}}};{{#ifeq: {{{padding|}}}|no|| padding-left:1.5em;}}">
 
[[File:{{{file|Hatena cinnamon2.jpg}}}|{{{width|400px}}}|alt={{{caption|}}}]]{{#if: {{{caption|}}}|
 
[[File:{{{file|Hatena cinnamon2.jpg}}}|{{{width|400px}}}|alt={{{caption|}}}]]{{#if: {{{caption|}}}|
<div style="font-size: 90%; margin-top:0.3em;">
+
<p style="font-size: 90%; margin-top:0.3em;">
 
{{{caption}}}
 
{{{caption}}}
</div>}}
+
</p>}}
 
</div><noinclude>
 
</div><noinclude>
 
<div style="clear:both;">
 
<div style="clear:both;">

Revision as of 19:03, 22 June 2013


Template documentation

This template is used to provide images with captions as an alternative to the ugly image captions that come with MediaWiki.

Syntax:

  • file= Sets which file to use. Default value is Hatena cinnamon2.jpg.
  • width= The maximum width of the image. Note that the image gets smaller so that it is never more than a certain percentage of the browser window. Defaults to 400px.
  • percentage= The percent width of the browser window the image takes up. The width proportionality is maintained until the image is at the maximum size; it does not get better. Defaults to 50%.
  • align= Sets alignment of image and caption block. Default value is right.
  • caption= Places a caption beneath the image, and also serves as the alt text. Optional.
  • padding= Gives the option to turn off padding, in case the image is part of a floating div already. Default is to include padding; turn off by setting parameter to "no".