Template:Align

From MozillaWiki
Jump to: navigation, search
{{{1}}}
Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{align}} aligns the output text (or other element) as centered, to the left, or to the right.

Parameters

There are 2 parameters, both unnamed, of which 1 is required and 1 is optional.

Syntax

The template's syntax is

  • {{align|custom text/element |alignment value }}

Required parameter

1

Custom text/element

The text (or other element) you wish to align. The parameter is unnamed, so no parameter name needs to be specified.

Note
  • This parameter must be placed before the 2nd parameter.
Usage
  • {{align|1}}

Optional parameter

2

Alignment

Specifies the alignment you want to impose on the text/element in parameter |1. The parameter is unnamed, so no parameter name needs to be specified.

Available values
Value Default
center
Green check.png
left
right
Notes
  • This parameter must be placed after the 1st parameter.
  • By default, this parameter will be set to the value center.
  • If a invalid value is entered, the template will display an error message.
Usage
  • {{align|1|2}}

Examples

Correct use

Element Alignment What you type What you see
Text Center This text is center-aligned}}
This text is center-aligned
This text is center-aligned|center}}
This text is center-aligned
Left This text is left-aligned|left}}
This text is left-aligned
Right This text is right-aligned|right}}
This text is right-aligned
Image Center [[File:Idea.png|20px|link=]]}}
Idea.png
[[File:Idea.png|20px|link=]]|center}}
Idea.png
Left [[File:Idea.png|20px|link=]]|left}}
Idea.png
Right [[File:Idea.png|20px|link=]]|right}}
Idea.png

Incorrect use

Alignment What you type What you see
Any other than
center,
left, or
right
This text will not be displayed|middle}} Error in {{align}}: the alignment value "middle" is invalid.

See also

Specific alignment