Template:Align
From MozillaWiki
{{{1}}}
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 | |
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=]]}} | |
[[File:Idea.png|20px|link=]]|center}} | |||
Left | [[File:Idea.png|20px|link=]]|left}} | ||
Right | [[File:Idea.png|20px|link=]]|right}} |
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
The above documentation is transcluded from Template:Align/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |