Difference between revisions of "Template:Align"

From blackwiki
Jump to navigation Jump to search
test>Mark Arsten
m (Changed protection level of Template:Align: Highly visible template ([Edit=Allow only template editors and admins] (indefinite) [Move=Block all non-admin users] (indefinite)))
test>Ahecht
(add style=)
Line 1: Line 1:
 
{{#switch: {{lc:{{{1|center}}}}}
 
{{#switch: {{lc:{{{1|center}}}}}
|left = <div style="float: left;">{{{2}}}</div>
+
|left = <div style="float: left;{{#if: {{{style|}}} | {{{style}}};}}">{{{2}}}</div>
|right = <div style="float: right;">{{{2}}}</div>
+
|right = <div style="float: right;{{#if: {{{style|}}} | {{{style}}};}}">{{{2}}}</div>
|center = {{center|{{{2}}} }}
+
|center = {{center|{{{2}}}|style={{{style|}}} }}
 
|#default = Error in [[Template:Align]]: the alignment setting "{{{1}}}" is invalid.
 
|#default = Error in [[Template:Align]]: the alignment setting "{{{1}}}" is invalid.
 
}}<noinclude>
 
}}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 17:25, 23 August 2018

{{{2}}}
Template documentation[view] [edit] [history] [purge]

This is a generic template for handling the horizontal alignment of elements on a page. Use the template like this:

{{align|position|content}}

Examples

{{align|left|'''Hello world!'''}} produces this:
Hello world!
{{align|right|'''Hello world!'''}} produces this:
Hello world!
{{align|center|'''Hello world!'''}} produces this:
Hello world!
{{align|center|'''Hello world!'''|style=color:red}} produces this:
Hello world!

See also