跳至內容

模板:Block center/s

維基文庫,自由的圖書館
文件圖示 模板文件[檢視] [編輯] [歷史] [清除快取]


用法

[編輯]

本模板將一段文字置於頁面中間,但不會影響段落本身的對齊方向。


對比{{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}}
頁腳

尾頁頁腳可留空。