Template:Float right
{{{1}}}
This template uses a See H:DIVSPAN for details. |
This template uses TemplateStyles: |
Usage
This template floats text to the right without changing the alignment. To align text to the right, use {{right}}.
Parameters
- 1 or text: The content of the right-floated text.
- 2 or offset: set the margin on the right (pushes the block in from the right of the page. Default is 0.
- 3 sets the top and bottom margin of floated text to the designated amount. Default is 0.
- 4 or gutter sets the margin (gutter) to the left of the floated text to the designated amount. Default is 0.
The distance parameters must include a unit (e.g. 2em
). Avoid using px units when the block contains textual content (see H:PXWIDTH for more details).
Offset
You can prevent the text from floating all the way to the right through the use of the offset parameter:
This text is outside the floated span. {{float right|'''This text is floated right with no offset.'''}} <br>This text is ''also'' outside the floated span.
yields
This text is outside the floated span. This text is floated right with no offset.This text is also outside the floated span.
but
This text is outside the floated span. {{float right|offset=3em|'''This text is floated right with an offset of 3em.'''}} <br>This text is ''also'' outside the floated span.
yields
This text is outside the floated span. This text is floated right with an offset of 3em.This text is also outside the floated span.
And
This text is outside the floated span. {{float right|'''This text is floated right with an offset of 3em, and with an equal margin top and bottom margin of 2em.'''|offset=3em|2em}} <br>This text is ''also'' outside the floated span.
yields
This text is outside the floated span. This text is floated right with an offset of 3em, and with an equal margin top and bottom margin of 2em.This text is also outside the floated span.
{{right}} versus {{float right}}
This template, {{float right}}, takes a block of text out of the normal text flow, and floats it as far right as possible, without changing how it is aligned; other text can flow around it, as if it were a picture or diagram. {{right}} retains the text in the normal flow, but causes it to be aligned along the right margin.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This text is Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This text is Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
See also
- {{float left}}
- {{float right/s}}
- {{block right}} - use this for "block" content (e.g. if the content has its own alignment within the right-floated block)
- {{block center}}
Float a block of text to the right of the page
Parameter | Description | Type | Status | |
---|---|---|---|---|
content | 1 content | The content to float right | Content | optional |
offset (from right margin) | offset 2 | The offset from the right margin
| Unknown | suggested |
left margin | 4 gutter | Left-hand margin
| Line | optional |
top and bottom margin | 3 | top and bottom margin
| Line | optional |
style | style | Extra CSS styles | Line | optional |
id | id | A CSS ID | Unknown | optional |