跳转到内容

模板:Block center/doc

維基文庫,自由的圖書館

用法

[编辑]

本模板将一段文字置于页面中间,但不会影响段落本身的对齐方向。


对比{{Block center}}与{{Center}}

本模板保留段落原本的对齐方向(通常为左边),但会将整段文字置于中间。若要把文字置中,请使用{{Center}}。

Block center

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

Center

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.


参数

[编辑]

{{{title}}}

[编辑]

Where there is a need to give the title of the work, an optional "title" parameter can be used. Sometimes this is will center the title better than a stand-alone line will; other times not - it usually depends on if a fixed width (next example) is forced or not.

{{block-center|title=LOREM IPSUM|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br/>
Aenean commodo ligula eget dolor.

Aenean massa.}}


LOREM IPSUM

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

{{{width}}}

[编辑]

Where there is a requirement to fix the width of the block, an optional "width" parameter can be used. Sometimes this is required to force a wider width when line wrap occurs.

{{block-center|width=300px|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br/>
Aenean commodo ligula eget dolor.

Aenean massa.}}


Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

{{{style}}}

[编辑]

使用“style”参数可以制定文字的格式,此参数接受所有能用在表格上的CSS格式。

{{block center|style=font-style:italic|<poem>
Lorem ipsum dolor sit amet,
{{gap}}consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
{{gap}}Aenean massa.
</poem>}}


Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
Aenean massa.

{{{align}}}

[编辑]

The text alignment within the (overall) centered block may be controlled using this (default: left):

{{block center|align=right|<poem>
Lorem ipsum dolor sit amet,
{{gap}}consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
{{gap}}Aenean massa.
</poem>}}


Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
Aenean massa.

Spanning multiple pages

[编辑]

If you use many separate block-centers you will find that every page has a slightly different alignment, however this template cannot be left "dangling" and closed on another page to create one big block-center. If you have a multipage block-center, you can use {{block center/s}} and {{block center/e}} to open and close it on each page. Every page must have one of each, one at the start and one at the end. However, you may place one or both of them in the header or footer, so they will not be transcluded to the main namespace. When the pages are all transcluded, you will end up with just one {{block center/s}} and just one {{block center/e}} at the start and end of the section, respectively.

首页

[编辑]
页眉

首页页眉可留空。

页体
{{block center/s}}
Start of the block center text.
Contents of the block center goes here.
页脚
{{block center/e}}

中间页

[编辑]
页眉
{{block center/s}}
页体
Contents of the block center go here; this continues the previous page.
页脚
{{block center/e}}

尾页

[编辑]
页眉
{{block center/s}}

页体
Contents of the block center go here; this continues the previous page.
Last bit of block center text
{{block center/e}}
页脚

尾页页脚可留空。