Template:Center/HTML4/doc: Difference between revisions
< Template:Center | HTML4
Jump to navigation
Jump to search
(→See also: Corr.) |
(Corrections.) |
||
Line 12: | Line 12: | ||
===Syntax=== | ===Syntax=== | ||
The template's syntax is | The template's syntax is | ||
* {{tlc|center|''custom text/element''}} | * {{tlc|center/HTML4|''custom text/element''}} | ||
===Required parameters=== | ===Required parameters=== | ||
====1==== | ====1==== | ||
;<big>Custom text/element</big> | ;<big>Custom text/element</big> | ||
The text (or other element) you wish to center-align. The parameter is unnamed, so no parameter name needs to be specified. | The text (or other element) you wish to center-align. The parameter is unnamed, so no parameter name needs to be specified. | ||
;<big>Usage</big> | ;<big>Usage</big> | ||
* {{tlc|center|<big>'''1'''</big>}} | * {{tlc|center/HTML4|<big>'''1'''</big>}} | ||
==Examples== | ==Examples== | ||
Line 27: | Line 27: | ||
! Case !! What you type !! style="width: 400px" | What you see | ! Case !! What you type !! style="width: 400px" | What you see | ||
|- | |- | ||
| Text || {{tlc|center|This text is center-aligned}} || {{center|This text is center-aligned}} | | Text || {{tlc|center/HTML4|This text is center-aligned}} || {{center/HTML4|This text is center-aligned}} | ||
|- | |- | ||
| Image || {{tlc|center|<nowiki>[[File:Idea.png|20px|link=]]</nowiki>}} || {{center|[[File:Idea.png|20px|link=]]}} | | Image || {{tlc|center/HTML4|<nowiki>[[File:Idea.png|20px|link=]]</nowiki>}} || {{center/HTML4|[[File:Idea.png|20px|link=]]}} | ||
|} | |} | ||
Line 38: | Line 38: | ||
;<big>Specific alignment</big> | ;<big>Specific alignment</big> | ||
* {{tl|center}}: uses the CSS styling attribute {{samp|style{{=}}"…"}} for alignment (HTML5 compliant). | * {{tl|center}}: uses the CSS styling attribute {{samp|style{{=}}"…"}} for alignment (HTML5 compliant). | ||
* {{tl|left}} | * {{tl|left}}: uses the CSS styling attribute {{samp|style{{=}}"…"}} for alignment (HTML5 compliant). | ||
* {{tl|right}} | * {{tl|left/HTML4}}: uses the HTML4 attribute {{samp|align{{=}}"…"}} (deprecated in HTML5). | ||
* {{tl|right}}: uses the CSS styling attribute {{samp|style{{=}}"…"}} for alignment (HTML5 compliant). | |||
* {{tl|right/HTML4}}: uses the HTML4 attribute {{samp|align{{=}}"…"}} (deprecated in HTML5). | |||
<includeonly> | <includeonly> |
Latest revision as of 10:59, 25 January 2015
Usage
{{center/HTML4}} encloses the input text or element code in <div>
tags and center-aligns the output block.
- Note
This template complies with HTML4 standards. In HTML5, the attribute used by this template, align, is deprecated. If you want to use HTML5, use the template {{center}} instead of this one.
Parameters
There is only 1 parameter, which is unnamed and required.
Syntax
The template's syntax is
{{center/HTML4|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/HTML4|1}}
Examples
Case | What you type | What you see |
---|---|---|
Text | {{center/HTML4|This text is center-aligned}} |
This text is center-aligned
|
Image | {{center/HTML4|[[File:Idea.png|20px|link=]]}} |
![]() |
See also
- General alignment
- {{align}}
- Specific alignment
- {{center}}: uses the CSS styling attribute style="…" for alignment (HTML5 compliant).
- {{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).