Template:Center/doc: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
Line 2: Line 2:
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}}
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>
<syntaxhighlight lang="html">
<div style="text-align: center;">
<div style="text-align: center;">
     <div style="margin: auto auto auto auto;">
     <div style="margin: auto auto auto auto;">
Line 8: Line 8:
     </div>
     </div>
</div>
</div>
</pre>
</syntaxhighlight>


{{tlx|centre}} works as well.
{{tlx|centre}} works as well.