Jump to content

Template:Caption

From NixOS Wiki

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.

The MediaWiki logo

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
}}
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
}}
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
}}
The MediaWiki logo

This text shows up below the figure.

Template data

Show a figure with a corresponding caption

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Figure content1

The content of the figure, that will be captioned

Contentrequired
Caption2

The caption to the figure, presenting additional information

Linerequired
Alternative textalt

Used by screen readers to describe the content of the figure

Linesuggested
Alignmentalign

Align the figure to the left, right or centre

Suggested values
left right center
Stringsuggested