Difference between revisions of "Template:Image"
Jump to navigation
Jump to search
James Hare (talk | contribs) (Creating template) |
James Hare (talk | contribs) (Merging from Scalable Image template) |
||
Line 1: | Line 1: | ||
− | <div style="width:{{{width|350px}}}; float:{{{align|right}}}; padding-left:1.5em;"> |
+ | <div class="banner-image" style="width:{{{percentage|50%}}}; max-width:{{{width|350px}}}; float:{{{align|right}}}; padding-left:1.5em;"> |
− | [[File:{{{file|Example title.svg}}}|{{{width|350px}}}|{{{align|right}}}]]{{#if: {{{caption|}}}| |
+ | [[File:{{{file|Example title.svg}}}|{{{width|350px}}}|{{{align|right}}}|alt={{{caption|}}}]]{{#if: {{{caption|}}}| |
<div style="font-size: 90%;"> |
<div style="font-size: 90%;"> |
||
{{{caption}}} |
{{{caption}}} |
||
Line 13: | Line 13: | ||
Syntax: |
Syntax: |
||
− | '''<tt> |
+ | * '''<tt>file=</tt>''' Sets which file to use. Default value is Example title.svg. |
+ | * '''<tt>width=</tt>''' 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. |
||
− | |||
+ | * '''<tt>percentage=</tt>''' 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%. |
||
− | '''<tt>align=</tt>''' Sets alignment of image and caption block. Default value is right. |
+ | * '''<tt>align=</tt>''' Sets alignment of image and caption block. Default value is right. |
− | |||
− | '''<tt> |
+ | * '''<tt>caption=</tt>''' Places a caption beneath the image, and also serves as the alt text. Optional. |
− | |||
− | '''<tt>caption=</tt>''' Places a caption beneath the image. Optional. |
||
</div> |
</div> |
Revision as of 07:02, 6 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 Example title.svg.
- 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.