Template:Center
From MozillaWiki
{{{1}}}
Usage
{{center}} encloses the input text or element code in <div>
tags and center-aligns the output block.
- Note
This template complies with HTML5 standards. In HTML5, the attribute align is deprecated. Instead, the template uses the CSS styling attribute style and the property:value pair text-align:center, to center-align the output. If you need to use HTML4, use the template {{center/HTML4}}.
Parameters
There is only 1 parameter, which is unnamed and required.
Syntax
The template's syntax is
-
{{center|custom text/element}}
Required parameters
1
- Custom text/element
The text (or other element) you wish to center-align. The parameter is unnamed, so no parameter name needs to be specified.
- Usage
-
{{center|1}}
Examples
Case | What you type | What you see |
---|---|---|
Text | This text is center-aligned}} | This text is center-aligned
|
Image | [[File:Idea.png|20px|link=]]}} |
See also
- General alignment
- {{align}}
- Specific alignment
- {{center/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).
- {{left}}: uses the CSS styling attribute style="…" for alignment (HTML5 compliant).
- {{left/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).
- {{right}}: uses the CSS styling attribute style="…" for alignment (HTML5 compliant).
- {{right/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).
The above documentation is transcluded from Template:Center/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. |