Template:Caption
Template Documentation [edit source| uses| help]
Use this template to show a figure with a corresponding caption. For accessibility purposes, the template also includes an alt
that will be used by screen readers to describe what the content inside the figure is. Do use the alt text, it is useful in 99% of cases.
Usage
Simply include the figure content as the first argument to the template, and the caption as the second:
{{caption
|alt=The MedaWiki logo, a stylised flower with an empty interior; the petals take colours from orange to burgundy in a gradient
|[[File:MediaWiki-2020-logo.svg|100px]]
|The MediaWiki logo
}}
You can also optionally set an alignment. By default, it will "break" the text before and after it. If setting the alignment to "right" or "left", the text will flow besides the figure. If setting it to "center", the figure will be positioned in the middle, but it will still break the text flow.
{{caption
|alt="The MedaWiki logo, a stylised flower with an empty interior; the petals take colours from orange to burgundy in a gradient"
|align=left
|[[File:MediaWiki-2020-logo.svg|100px]]
|The MediaWiki logo
}}
This text flows alongside the figure.
{{caption
|alt="The MedaWiki logo, a stylised flower with an empty interior; the petals take colours from orange to burgundy in a gradient"
|align=right
|[[File:MediaWiki-2020-logo.svg|100px]]
|The MediaWiki logo
}}
This text flows alongside the figure.
{{caption
|alt="The MedaWiki logo, a stylised flower with an empty interior; the petals take colours from orange to burgundy in a gradient"
|align=center
|[[File:MediaWiki-2020-logo.svg|100px]]
|The MediaWiki logo
}}
This text shows up below the figure.
Template data
Show a figure with a corresponding caption
Parameter | Description | Type | Status | |
---|---|---|---|---|
Figure content | 1 | The content of the figure, that will be captioned | Content | required |
Caption | 2 | The caption to the figure, presenting additional information | Line | required |
Alternative text | alt | Used by screen readers to describe the content of the figure | Line | suggested |
Alignment | align | Align the figure to the left, right or centre
| String | suggested |