模板:Box

維基教科書,自由的教學讀本
Sample Text
文檔圖示 模板文檔[檢視] [編輯] [歷史] [清除快取]

使用[編輯]

標準方式: {{box|內容}}
特殊參數
參數 說明 示例
|type= 背景選項(black, white, transparent)
black
 
white
 
transparent
|span= 編譯成html時,是否使用span而非div。 內容
|wide= 是否與頁面/表格同寬
內容
|inline= 是否與文字並列 文字
Box
文字
|header= 添加額外標題
標題
內容
|shadow= Box後是否有陰影
內容
一般參數
Parameter Description Default CSS
"content" The contents of the box (Highly Recommend)
opt1
 |background=
opt2
 |color=
The color of the background of the box White background-color
|align= The alignment of the box (left, center, right) (Recommended) left float
|padding= The inner padding of the border 3px padding
|style= The style of the border Solid border-style
|border color= The color of the border Black background-color
|border size= The size of the border 3px border-width
|text align= The alignment of the text (Recommended) left text-align
|spacing= The spacing of the letters letter-spacing
|font= The font of the box's text font-family
|font size= The font size of the box's text font-size
|text color= The color of the text black text-color
|margin= The outer margin of the box (Only does horizontal when type isn't inline-block or block) 3px margin
|box type= The type of box (inline, inline-block, block) inline-block display
|height= The height of the box height
|width= The width of the box (The width of the text) width
|CSS= Any Additional CSS you want to add

(make sure to add ; to end)

其他參數
Parameter Description Default CSS
|top margin= The top outer margin of the box (Only does horizontal when type isn't inline-block or block) 3px margin-top
|bottom margin= The bottom outer margin of the box (Only does horizontal when type isn't inline-block or block) 3px margin-bottom
|left margin= The left outer margin of the box (Only does horizontal when type isn't inline-block or block) 3px margin-left
|right margin= The right outer margin of the box (Only does horizontal when type isn't inline-block or block) 3px margin-right
|top padding= The top inner padding of the border 3px padding-top
|bottom padding= The bottom inner padding of the border 3px padding-bottom
|left padding= The left inner padding of the border 3px padding-left
|right padding= The right inner padding of the border 3px padding-right
|radius= Border radius 0 border-radius

範例[編輯]

A
B
C
{{box|A|background=red|text color=white}}

{{box|B|background=blue|text color=orange}}

{{box|C|background=black|text color=white|margin=0px|height=1em|width=40px|border color=yellow}}

DOG
{{box|spacing=5px|height=50px|DOG}}

The quick brown fox jumps over the lazy dog
{{box|background=yellow|align=center|border size=10px|radius=20px|text align=center|The quick brown fox jumps over the lazy dog}}

模板參數[編輯]

This template produces a variety of boxes from preset options and from CSS.

模板參數[編輯模板資料]

此模板以參數行內格式為優先。

參數描述類型狀態
11

The contents of the box

範例
Hello, world!
不明建議
headerheader

A heading for the box

範例
Warning
不明建議
alignalign

The alignment of the box

預設
left
範例
center
不明建議
box typebox type

The type of box (css display) (block,inline-block or inline)

範例
block
自動值
inline-block
不明非必填
widewide

If set to yes the box will be wide

預設
no
範例
yes
自動值
布林值非必填
inlineinline

Set to yes for the box type to be inline

預設
no
範例
yes
布林值非必填
stylestyle

The style of the border

預設
solid
不明非必填
paddingpadding

The padding of the box

預設
3px
不明非必填
top paddingtop padding

The top padding of the box

不明非必填
bottom paddingbottom padding

Thebottom padding of the box

不明非必填
left paddingleft padding

The left padding of the box

不明非必填
right paddingright padding

The right padding of the box

不明非必填
border colorborder color

The color of the box border

預設
black
範例
red
字串非必填
radiusradius

Border corner radius

預設
0
範例
5em
不明非必填
typetype

The type of box (black,white,transparent)

範例
black
不明非必填
border sizeborder size

The size of the border

預設
3px
不明非必填
colorcolor background

The color of background

預設
white
範例
black
不明非必填
text colortext color

The color of the text

預設
black
範例
green
不明非必填
text aligntext align

The alignment of the text (css text-align)

預設
left
範例
center
不明非必填
spacingspacing

The spacing of the letters

不明非必填
fontfont

The font of the text

不明非必填
font sizefont size text size

The size of the text

不明非必填
marginmargin

The size of the box's margin

預設
3px
範例
30px
不明非必填
top margintop margin

The size of the box's top margin

不明非必填
bottom marginbottom margin

The size of the box's bottom margin

不明非必填
left marginleft margin

The size of the box's left margin

不明非必填
right marginright margin

The size of the box's right margin

不明非必填
heightheight

The height of the box

預設
''the height of the contents plus the margin''
範例
400px
不明非必填
widthwidth

The width of the box

預設
''the width of the text plus the margin''
不明非必填
CSSCSS

Any additional CSS to use

不明非必填