Template:Center/doc: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m Slight rewording
Line 1: Line 1:
{{dochead}}{{wikipedia}}
{{dochead}}{{wikipedia}}
The <code><nowiki><center></nowiki></code> tag in {{w|HTML}} is now deprecated, and there is no one-size-fits-all replacement for it. This template is designed to replicate the tag's functionality using nested <code><nowiki><div></nowiki></code> elements as a workaround so that they do not need to be typed in every time something needs to be centered: {{clear}}
The <code><<nowiki />center></code> tag in {{w|HTML}} is now deprecated, and there is no one-size-fits-all replacement for it. This template is designed to replicate the tag's functionality using nested <code><<nowiki />div></code> elements as a workaround so that they do not need to be typed in every time something needs to be centered: {{clear}}


<pre><div style="text-align: center;">
<pre>
<div style="text-align: center;">
     <div style="margin: auto auto auto auto;">
     <div style="margin: auto auto auto auto;">
     ...
     ...
     </div>
     </div>
</div></pre>
</div>
</pre>


{{tlx|centre}} works as well.
{{tlx|centre}} works as well.
Line 25: Line 27:


; <code>both</code> (optional)
; <code>both</code> (optional)
: Pass in this to set both upper and lower margins to the same desired value. Note that this will override any margin specified using <code>top</code> or <code>bottom</code>.
: Pass in a desired size to set both upper and lower margins to the same desired value. Note that this will override <code>top</code> and <code>bottom</code>.