跳转到内容

模板:Float right/doc

維基文庫,自由的圖書館

Usage

[编辑]

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

Offset

[编辑]

You can prevent the text from floating all the way to the right through the use of the offset parameter:

{{float right|'''This text is floated right with no offset.'''}}

yields This text is floated right with no offset.{{{1}}} but

{{float right|offset=3em|'''This text is floated right with an offset of 3em.'''}}

yields This text is floated right with an offset of 3em.{{{1}}}

{{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.

Parameters

[编辑]
  • 1st {{{text}}}
  • 2nd {{{o}}} the same effect as the offset= parameter
  • 3rd {{{x}}} sets the top and bottom margin of floated text to the designated amount
  • 4th {{{y}}} sets the margin (gap) to the left of the floated text to the designated amount.

The distance parameters must include a unit (e.g. 2em, unlike in {{float left}} where a unit of em is assumed.

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

[编辑]