Template:Float: Difference between revisions
Jump to navigation
Jump to search
Want an adless experience? Log in or Create an account.
(lolwasbroken) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<onlyinclude>{{#switch: {{{1|}}} | <onlyinclude>{{#switch: {{lc:{{{1|}}}}} | ||
| left = <div style="float: left; margin-right: {{{pad|1em}}}; {{{style|}}}"> | | left = <div style="float: left; margin-right: {{{pad|1em}}}; {{{style|}}}"> | ||
| right = <div style="float: right; margin-left: {{{pad|1em}}}; {{{style|}}}"> | | right = <div style="float: right; margin-left: {{{pad|1em}}}; {{{style|}}}"> |
Latest revision as of 17:02, September 9, 2024
Purpose
This template slightly simplifies floating sections of wikitext to one side of the page. It also allows a more intuitive way of centering.
Usage
{{Float| side | content }}
- side — Which direction to float. Valid values are left, right, and center.
- content — The content to be floated. (Optional.)
Sometimes it is inconvenient to pass the content as a parameter, such as when it includes pipe characters ( | ) or equal signs ( = ). In these cases, omit the "content" parameter and place the content directly after and outside of the {{Float| side }} template, followed by {{Float| end }}.
To push text below the floated block, see {{Clear}}.
Some additional styling options are available:
{{Float| side | pad= | style= | content }}
- pad — How much space between the floated block and the surrounding content. Must include a unit such as 'em' or 'px'. (Optional. Default: 1em)
- style — Hook for additional style control. (Optional.)