附录A:CSS 2.1属性表

注:

  1. “适用于”一列内,缺省为“全部”。
  2. “目录”一列内,为该内容所在的章节。
附录A:CSS 2.1属性表
属性名称 说明 值 初始值 适用于 继承 媒体组 目录
azimuth 设置音频在空间内的角度。 <角度> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inherit center   √ 听觉 15.7
background-attachment 设置元素的背景图片的显示方式 scroll | fixed | inherit scroll   × 视觉 10.3
background-color 设置元素的背景颜色 <颜色> | transparent | inherit transparent   × 视觉 10.3
background-image 设置元素的背景图片 <uri> | none | inherit none   × 视觉 10.3
background-position 设置元素的背景图片的起始位置 [ [ <百分比> | <长度> | left | center | right ] [ <百分比> | <长度> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit 0% 0%   × 视觉 10.3
background-repeat 设置元素的背景图片重复的方式 repeat | repeat-x | repeat-y | no-repeat | inherit repeat   × 视觉 10.3
background 设置元素的背 [background-color || background-image || background-repeat || background-attachment || background-position] | inherit 视各属性而定   × 视觉 10.3
border-collapse 设置表格边框的显示方式 collapse | separate | inherit separate table 和 inline-table √ 视觉 11.4
border-color 设定元素边框的颜色 [ <颜色> | transparent ]{1,4} | inherit 视各属性而定   × 视觉 8.8
border-spacing 设置分隔相邻的单元格之间的距离 <长度> <长度>? | inherit 0 table 和 inline-table √ 视觉 11.4
border-style 设定元素边框的线型 <border-style>{1,4} | inherit 视各属性而定   × 视觉 8.8
border-top 设定元素的边框颜色、宽度和样式 [ <border-width> || <border-style> || <border-top-color> ] | inherit 视各属性而定   × 视觉 8.8
border-right
border-bottom
border-left
border-top-color
设定元素边框的颜色 <颜色> | transparent | inherit color属性定义的值   × 视觉 8.8
border-right-color
border-bottom-color
border-left-color
border-top-style 设定元素边框的线型 <border-style> | inherit none   × 视觉 8.8
border-right-style
border-bottom-style
border-left-style
border-top-width 设定元素边框的宽度 <border-width> | inherit medium   × 视觉 8.8
border-right-width
border-bottom-width
border-left-width
border-width 设定元素边框的宽度 <border-width>{1,4} | inherit 视各属性而定   × 视觉 8.8
border 设定元素的边框颜色、宽度和样式 [ <border-width> || <border-style> || <border-top-color> ] | inherit 视各属性而定   × 视觉 8.8
bottom 设定元素的框的边距的下边相对该框的包含块的下边向上偏移的量 <长度> | <百分比> | auto | inherit auto 定位元素 × 视觉 9.3
caption-side 设置表格中标题<caption>元素的位置 top | bottom | inherit top table-caption √ 视觉 11.3
clear 设定不允许有浮动元素的边 none | left | right | both | inherit none 块级元素 × 视觉 9.4
clip 设定元素经渲染的内容的哪一部分是可见的 <形状> | auto | inherit auto 绝对定位元素 × 视觉 9.6
color 设置元素的前景色 <颜色> | inherit 由用户端决定   √ 视觉 10.2
content 设置生成的内容 normal | none | [ <字符串> | <uri> | <计数器> | attr(<标识符>) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit normal :before 和 :after 伪元素 × 全部 12.2
counter-increment 元素每次出现时,计数器按照指定的增量计数 [ <标识符> <整数>? ]+ | none | inherit none   × 全部 12.2
counter-reset 将指定选择器的计数器复位 [ <标识符> <整数>? ]+ | none | inherit none   × 全部 12.2
cue-after 设置元素后面插入的音频标记 <uri> | none | inherit none   × 听觉 15.5
cue-before 设置元素前面插入的音频标记 <uri> | none | inherit none   × 听觉 15.5
cue 设置元素的音频标记 [ cue-before || cue-after ] | inherit 视各属性而定   × 听觉 15.5
cursor 设置鼠标光标的外观 [ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | inherit auto   √ 视觉, 交互 13.1
direction 设置元素文本流入的方向 ltr | rtl | inherit ltr 全部(详见正文) √ 视觉 7.10
display 设定元素的显示类型 inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit inline   × 全部 9.2
elevation 设置语音在垂直方向的角度 <角度> | below | level | above | higher | lower | inherit level   √ 听觉 15.7
empty-cells 设置分隔相邻的单元格之间的距离 show | hide | inherit show table-cell类元素 √ 视觉 11.4
float 指定一个框是否应该向左、向右浮动或不浮动 left | right | none | inherit none 全部(详见第9.5节) × 视觉 9.4
font-family 设定元素内文本的字体名称 [[ <family-name> | <generic-family> ] [, <family-name>| <generic-family>]* ] | inherit 由用户端决定   √ 视觉 6.1
font-size 设定元素内文字的尺寸 <绝对尺寸> | <相对尺寸> | <长度> | <百分比> | inherit medium   √ 视觉 6.2
font-style 设定元素内文字的样式 normal | italic | oblique | inherit normal   √ 视觉 6.4
font-variant 设定元素中的文本是否为小型的大写字母 normal | small-caps | inherit normal   √ 视觉 6.5
font-weight 设定元素内文字的粗细 normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit normal   √ 视觉 6.3
font 设定元素中文本的字体属性 [ [ font-style || font-variant || font-weight ]? font-size [ / line-height ]? font-family ] | caption | icon | menu | message-box | small-caption | status-bar | inherit 视各属性而定   √ 视觉 6.6
height 设定块级元素和替换元素生成的内容框的高度 <长度> | <百分比> | auto | inherit auto 全部,除了非替换行内元素、表格列和列祖 × 视觉 8.5
left 设定元素的框的边距的左边相对该框的包含块的左边向右偏移的量 <长度> | <百分比> | auto | inherit auto 定位元素 × 视觉 9.3
letter-spacing 设置元素内字母之间的间隔 normal | <长度> | inherit normal   √ 视觉 7.5
line-height 设置元素中行的高度。 normal | <实数> | <长度> | <百分比> | inherit normal   √ 视觉 7.3
list-style-image 设置列表项标记的图片 <uri> | none | inherit none display: list-item 的元素 √ 视觉 12.1
list-style-position 设置列表项标记的位置 inside | outside | inherit outside display: list-item 的元素 √ 视觉 12.1
list-style-type 设置列表项的标记样式类型 disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit disc display: list-item 的元素 √ 视觉 12.1
list-style 设置列表项标记的样式 [ list-style-type || list-style-position || list-style-image ] | inherit 视各属性而定 display: list-item 的元素 √ 视觉 12.1
margin-right
设定元素边距的宽度 <margin-width> | inherit 0 全部,表格类元素只包括table-caption、table 和inline-table × 视觉 8.9
margin-left
margin-top 设定元素边距的宽度 <margin-width> | inherit 0 全部,表格类元素只包括table-caption、table 和inline-table × 视觉 8.9
margin-bottom
margin 设定元素边距的宽度 <margin-width>{1,4} | inherit 视各属性而定 全部,表格类元素只包括table-caption、table 和inline-table × 视觉 8.9
max-height 设定元素的最大高度 <长度> | <百分比> | none | inherit none 全部,除了非替换行内元素、表格列和列组 × 视觉 8.6
max-width 设定元素的最大宽度 <长度> | <百分比> | none | inherit none 全部,除了非替换行内元素、表格行和行组 × 视觉 8.4
min-height 设定元素的最小高度 <长度> | <百分比> | inherit 0 全部,除了非替换行内元素、表格列和列组 × 视觉 8.6
min-width 设定元素的最小宽度 <长度> | <百分比> | inherit 0 全部,除了非替换行内元素、表格行和行组 × 视觉 8.4
orphans 段落中必须遗留在一个页面底部的行数的最小数目 <整数> | inherit 2 块级元素 √ 视觉, 页面 14.4
outline-color 设置外廓的颜色 <颜色> | invert | inherit invert   × 视觉, 交互 13.3
outline-style 设置外廓的样式 <border-style> | inherit none   × 视觉, 交互 13.3
outline-width 设置外廓的宽度 <border-width> | inherit medium   × 视觉, 交互 13.3
outline 设置外廓的颜色样式和宽度 [ outline-color || outline-style || outline-width ] | inherit 视各属性而定   × 视觉, 交互 13.3
overflow 设定当一个块类元素的内容溢出了元素的框(它作为内容的包含块)时,是否剪切 visible | hidden | scroll | auto | inherit visible 非替换块级元素,单元格和行内块 × 视觉 9.6
padding-top 设定元素补白的宽度 <padding-width> | inherit 0 全部,除了table-row-group、table-header-group、table-footer-group、table-row、table-column-group和table-column类元素 × 视觉 8.7
padding-right
padding-bottom
padding-left
padding 设定元素补白的宽度 <padding-width>{1,4} | inherit 视各属性而定 全部,除了table-row-group、table-header-group、table-footer-group、table-row、table-column-group和table-column类元素 × 视觉 8.7
page-break-after 设置在元素的后面分页 auto | always | avoid | left | right | inherit auto 块级元素 × 视觉, 页面 14.4
page-break-before 设置在元素的前面分页 auto | always | avoid | left | right | inherit auto 块级元素 × 视觉, 页面 14.4
page-break-inside 设置在元素的内部是否允许分页 avoid | auto | inherit auto 块级元素 √ 视觉, 页面 14.4
pause-after 设置语音在元素后暂停 <时间> | <百分比> | inherit 0   × 听觉 15.4
pause-before 设置语音在元素前暂停 <时间> | <百分比> | inherit 0   × 听觉 15.4
pause 设置语音的暂停 [ [<时间> | <百分比>]{1,2} ] | inherit 视各属性而定   × 听觉 15.4
pitch-range 设置音高的变化范围 <实数> | inherit 50   √ 听觉 15.8
pitch 设置嗓音的频率 <频率> | x-low | low | medium | high | x-high | inherit medium   √ 听觉 15.8
play-during 设置元素的内容被读出时播放的声音 <uri> [ mix || repeat ]? | auto | none | inherit auto   × 听觉 15.6
position 设定元素的定位方式 static | relative | absolute | fixed | inherit static   × 视觉 9.3
quotes 设置生成内容的引号 [<字符串> <字符串>]+ | none | inherit 由用户端决定   √ 视觉 12.2
richness 设置音色 <实数> | inherit 50   √ 听觉 15.8
right 设定元素的框的边距的右边相对该框的包含块的右边向左偏移的量 <长度> | <百分比> | auto | inherit auto 定位元素 × 视觉 9.3
speak-header 设置如何读出表头与单元格的联系 once | always | inherit once 具有表格头部信息的元素 √ 听觉 15.10
speak-numeral 设置如何读出数字 digits | continuous | inherit continuous   √ 听觉 15.9
speak-punctuation 设置是否读出标点符号 code | none | inherit none   √ 听觉 15.9
speak 设置元素的内容是否需要读出来 normal | none | spell-out | inherit normal   √ 听觉 15.3
speech-rate 设置语音发音的速率 <实数> | x-slow | slow | medium | fast | x-fast | faster | slower | inherit medium   √ 听觉 15.8
stress 设置声音波形的最高峰值 <实数> | inherit 50   √ 听觉 15.8
table-layout 设置布局表格单元格、行、列的算法 auto | fixed | inherit auto table和inline-table × 视觉 11.3
text-align 设置元素内文本的水平对齐方式 left | right | center | justify | inherit left(direction:ltr), 或right(direction:rtl) 块级元素、单元格和行内块 √ 视觉 7.1
text-decoration 设置元素内文本的装饰 none | [ underline || overline || line-through || blink ] | inherit none   × 视觉 7.7
text-indent 设置元素中第一行文本的缩进 <长度> | <百分比> | inherit 0 块级元素、单元格和行内块 √ 视觉 7.2
text-transform 设置元素内文本的大小写 capitalize | uppercase | lowercase | none | inherit none   √ 视觉 7.6
top 设定元素的框的边距的顶边相对该框的包含块的顶边向下偏移的量 <长度> | <百分比> | auto | inherit auto 定位元素 × 视觉 9.3
unicode-bidi 用于同一个页面里存在从不同方向读进的文本显示 normal | embed | bidi-override | inherit normal 全部,详见正文 × 视觉 7.10
vertical-align 设置元素内容的垂直对齐方式 baseline | sub | super | top | text-top | middle | bottom | text-bottom | <百分比> | <长度> | inherit baseline 行内级和table-cell类元素 × 视觉 7.4
visibility 设定元素是否可视 visible | hidden | collapse | inherit visible   √ 视觉 9.7
voice-family 设置语音的嗓音 [[<specific-voice> | <generic-voice> ],]* [<specific-voice> | <generic-voice> ] | inherit 由用户端决定   √ 听觉 15.8
volume 设置语音的音量 <实数> | <百分比> | silent | x-soft | soft | medium | loud | x-loud | inherit medium   √ 听觉 15.2
white-space 设置元素内空格的处理方式 normal | pre | nowrap | pre-wrap | pre-line | inherit normal   √ 视觉 7.8
widows 设置元素必须遗留在一个页面顶部的行数的最小数目 <整数> | inherit 2 块级元素 √ 视觉, 页面 14.4
width 设定块级元素和替换元素产生的内容框的宽度 <长度> | <百分比> | auto | inherit auto 全部,除了非替换行内元素、表格行和行组 × 视觉 8.3
word-spacing 设置元素内单词之间的间隔,会受文字对齐方式影响 normal | <长度> | inherit normal   √ 视觉 7.5
z-index 设定定位元素的当前堆叠内容中框的堆叠次序 auto | <整数> | inherit auto 定位元素 × 视觉 9.3
属性名称 说明 值 初始值 适用于(缺省为[全部]) 继承 媒体组 目录