Template:Center/doc: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) m Styling doesn't need to be done here |
||
Line 13: | Line 13: | ||
; <code><nowiki>{{{1}}}</nowiki></code> '''(required)''' | ; <code><nowiki>{{{1}}}</nowiki></code> '''(required)''' | ||
: One unnamed parameter, consisting of the text to be centered. | : One unnamed parameter, consisting of the text to be centered. | ||
; <code>top</code> '''(optional)''' | ; <code>top</code> '''(optional)''' | ||
: Pass in the desired upper margin. | : Pass in the desired upper margin. The default value is <code>auto</code>. | ||
; <code>bottom</code> '''(optional)''' | ; <code>bottom</code> '''(optional)''' | ||
: Pass in the desired lower margin. | : Pass in the desired lower margin. The default value is <code>auto</code>. |
Revision as of 06:19, 9 December 2024
The <center>
tag was deprecated in HTML 4, and there is no easy replacement for it. This template replicates the tag's functionality using a workaround via nested <div>
elements:
<div style="text-align: center;"> <div style="margin: auto auto auto auto;"> ... </div> </div>
This template eliminates the need to manually type out the <div>
elements every time something needs to be centered.
Parameters
{{{1}}}
(required)- One unnamed parameter, consisting of the text to be centered.
top
(optional)- Pass in the desired upper margin. The default value is
auto
.
bottom
(optional)- Pass in the desired lower margin. The default value is
auto
.