Jump to content

Formula:Float right/doc

E Wikisource

Usage

[recensere]

This template floats text to the right without changing the alignment. To align text to the right, use {{right}}.

Parameters

[recensere]
  • 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 contents.

Offset

[recensere]

You can prevent the text from floating all the way to the right through the use of the tt|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}}

[recensere]

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, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.
This text is

right aligned

using {{right}}.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

This text is
floated right
using {{float right}}.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

See also

[recensere]


Float a block of text to the right of the page

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptioTypusStatus
content1 content

The content to float right

Contentoptional
offset (from right margin)offset 2

The offset from the right margin

Praedeterminatum
0
Example
2em
Unknownsuggested
left margin4 gutter

Left-hand margin

Praedeterminatum
0
Example
1em
Lineoptional
top and bottom margin3

top and bottom margin

Praedeterminatum
0
Example
1em
Lineoptional
stylestyle

Extra CSS styles

Lineoptional
idid

A CSS ID

Unknownoptional