跳转到内容

模板:Box/doc

维基教科书,自由的教学读本

使用

[编辑]
标准方式: {{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

未知可选