CSS2 属性速查

CSS背景属性

属性 描述 IE F N W3C
background 简写属性,作用是将背景属性设置在一个声明中。
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position
4 1 6 1
background-attachment 设置是否背景图像是固定的或随页面其余部分滚动。
  • scroll
  • fixed
4 1 6 1
background-color 设置元素的背景颜色。
  • color-rgb
  • color-hex
  • color-name
  • transparent
4 1 4 1
background-image 将图像设置为背景。
  • url
  • none
4 1 4 1
background-position 设置背景图像的起始位置。
  • top left
  • top center
  • top right
  • center left
  • center center
  • center right
  • bottom left
  • bottom center
  • bottom right
  • x-% y-%
  • x-pos y-pos
4 1 6 1
background-repeat 设置背景图像是否及如何重复。
  • repeat
  • repeat-x
  • repeat-y
  • no-repeat
4 1 4 1

CSS 边框属性(border)

属性 描述 IE F N W3C
border 简写属性。作用是在一个声明中用来设置四个边框的所有属性。
  • border-width
  • border-style
  • border-color
4 1 4 1
border-bottom 简写属性。作用是在一个声明中用来设置底边框的所有属性。
  • border-bottom-width
  • border-style
  • border-color
4 1 6 1
border-bottom-color 设置底边框的颜色。 border-color 4 1 6 2
border-bottom-style 设置底边框的样式。 border-style 4 1 6 2
border-bottom-width 设置底边框的宽度。
  • thin
  • medium
  • thick
  • length
4 1 4 1
border-color 设置四个边框的颜色,可以设置一到四个颜色。 color 4 1 6 1
border-left 简写属性。用于在一个声明中设置左边框的所有属性。
  • border-left-width
  • border-style
  • border-color
4 1 6 1
border-left-color 设置左边框的颜色 border-color 4 1 6 2
border-left-style 设置左边框的样式。 border-style 4 1 6 2
border-left-width 设置左边框的宽度。
  • thin
  • medium
  • thick
  • length
4 1 4 1
border-right 简写属性。将所有用于右边框的属性设置于一个声明中。
  • border-right-width
  • border-style
  • border-color
4 1 6 1
border-right-color 设置右边框的颜色 border-color 4 1 6 2
border-right-style 设置右边框的样式 border-style 4 1 6 2
border-right-width 设置右边框的宽度。
  • thin
  • medium
  • thick
  • length
4 1 4 1
border-style 设置四个边框的样式,可以设置一到四个样式。
  • none
  • hidden
  • dotted
  • dashed
  • solid
  • double
  • groove
  • ridge
  • inset
  • outset
4 1 6 1
border-top 简写属性。将所有用于顶边框的属性设置于一个声明中。
  • border-top-width
  • border-style
  • border-color
4 1 6 1
border-top-color 设置顶边框的颜色。 border-color 4 1 6 2
border-top-style 设置顶边框的样式。 border-style 4 1 6 2
border-top-width 设置顶边框的宽度。
  • thin
  • medium
  • thick
  • length
4 1 4 1
border-width 简写属性。在一个声明中设置四个边框的宽度,可以设置一到四个值。
  • thin
  • medium
  • thick
  • length
4 1 4 1

CSS文本属性

属性 描述 IE F N W3C
color 设置文本颜色 color 3 1 4 1
direction 设置文本方向
  • ltr
  • rtl
6 1 6 2
letter-spacing 增加或减少字符间距
  • normal
  • length
4 1 6 1
text-align 排列元素中的文本
  • left
  • right
  • center
  • justify
4 1 4 1
text-decoration 向文本添加修饰
  • none
  • underline
  • overline
  • line-through
  • blink
4 1 4 1
text-indent 缩进元素中文本的首行
  • length
  • %
4 1 4 1
text-shadow  
  • none
  • color
  • length
       
text-transform 控制元素中的字母
  • none
  • capitalize
  • uppercase
  • lowercase
4 1 4 1
unicode-bidi  
  • normal
  • embed
  • bidi-override
5     2
white-space 设置元素中空白的处理方式
  • normal
  • pre
  • nowrap
5 1 4 1
word-spacing 增加或减少字间距
  • normal
  • length
6 1 6 1

CSS字体属性(font)

属性 描述 IE F N W3C
font 简写属性。作用是将所有针对字体的属性设置在一个声明中。
  • font-style
  • font-variant
  • font-weight
  • font-size/line-height
  • font-family
  • caption
  • icon
  • menu
  • message-box
  • small-caption
  • status-bar
4 1 4 1
font-family 字体类型名称或者针对某元素的类属族名名称的优先列表。
  • family-name
  • generic-family
3 1 4 1
font-size 设置字体的尺寸
  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large
  • smaller
  • larger
  • length
  • %
3 1 4 1
font-size-adjust Specifies an aspect value for an element that will preserve the x-height of the first-choice font none number - - - 2
font-stretch Condenses or expands the current font-family
  • normal
  • wider
  • narrower
  • ultra-condensed
  • extra-condensed
  • condensed
  • semi-condensed
  • semi-expanded
  • expanded
  • extra-expanded
  • ultra-expanded
- - - 2
font-style 设置字体样式
  • normal
  • italic
  • oblique
4 1 4 1
font-variant 以小型小写字体或者正常字体显示文本
  • normal
  • small-caps
4 1 6 1
font-weight 设置字体的粗细。
  • normal
  • bold
  • bolder
  • lighter
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
4 1 4 1

CSS 边距属性(border)

属性 描述 IE F N W3C
margin 简写属性。在一个声明中设置边距属性
  • margin-top
  • margin-right
  • margin-bottom
  • margin-left
4 1 4 1

margin-bottom

设置元素的下边距
  • auto
  • length
  • %
4 1 4 1

margin-left

设置元素的左边距
  • auto
  • length
  • %
3 1 4 1

margin-right

设置元素的右边距
  • auto
  • length
  • %
3 1 4 1
margin-top 设置元素的上边距
  • auto
  • length
  • %
3 1 4 1

CSS 填充属性(padding)

属性 描述 IE F N W3C
padding 简写属性。作用是在一个声明中设置元素的填充属性。
  • padding-top
  • padding-right
  • padding-bottom
  • padding-left
4 1 4 1

padding-bottom

设置元素底端的填充
  • length
  • %
4 1 4 1

padding-left

设置元素左侧的填充
  • length
  • %
4 1 4 1

padding-right

设置元素右侧的填充
  • length
  • %
4 1 4 1
padding-top 设置元素顶端的填充
  • length
  • %
4 1 4 1

CSS 列表属性(list)

属性 描述 IE F N W3C
list-style 简写属性。用于将所有用于列表的属性设置于一个声明之中。
  • list-style-type
  • list-style-position
  • list-style-image
4 1 6 1
list-style-image 将图象设置为列表项标记
  • none
  • url
4 1 6 1
list-style-position 设置列表中列表项标记被放置的位置
  • inside
  • outside
4 1 6 1
list-style-type 设置列表项标记的类型
  • none
  • disc
  • circle
  • square
  • decimal
  • decimal-leading-zero
  • lower-roman
  • upper-roman
  • lower-alpha
  • upper-alpha
  • lower-greek
  • lower-latin
  • upper-latin
  • hebrew
  • armenian
  • georgian
  • cjk-ideographic
  • hiragana
  • katakana
  • hiragana-iroha
  • katakana-iroha
4 1 4 1
marker-offset  
  • auto
  • length
  1 7 2

内容生成

属性 描述 IE F N W3C
content 生成文档中的内容。与:before 以及 :after伪元素配合使用 string
url
counter(name)
counter(name, list-style-type)
counters(name, string)
counters(name, string, list-style-type)
attr(X)
open-quote
close-quote
no-open-quote
no-close-quote
  1 6 2
counter-increment 设置每当某个选择器出现时计数器的增加值 none
identifier number
      2
counter-reset 设置每当某个选择器出现时计数器被设置的值 none
identifier number
      2
quotes 设置引号的类型 none
string string
- 1 6 2

轮廓

属性 描述 IE F N W3C
outline 简写属性。用来在一个声明中设置所有的outline属性。 outline-color
outline-style
outline-width
- 1.5 - 2
outline-color 设置围绕元素的轮廓的颜色 color
invert
- 1.5 - 2
outline-style 设置围绕元素的轮廓的样式 none
dotted
dashed
solid
double
groove
ridge
inset
outset
- 1.5 - 2
outline-width 设置围绕元素的轮廓的宽度 thin
medium
thick
length
- 1.5 - 2

CSS 尺寸属性(Dimension)

属性 描述 IE F N W3C
height 设置元素高度
  • auto
  • length
  • %
    4 1 6 1
    line-height 设置行间距
    • normal
    • number
    • length
    • %
    4 1 4 1
    max-height 设置元素的最大高度
    • none
    • length
    • %
    - 1 6 2
    max-width 设置元素的最大宽度
    • none
    • length
    • %
    - 1 6 2
    min-height 设置元素的最小高度
    • length
    • %
    - 1 6 2
    min-width 设置元素的最小宽度
    • length
    • %
    - 1 6 2
    width 设置元素的宽度
    • auto
    • %
    • length
    4 1 4 1

    CSS 分类属性 (Classification)

    属性 描述 IE F N W3C
    clear 设置不允许存在浮动对象的边
    • left
    • right
    • both
    • none
    4 1 4 1
    cursor 规定光标类型(形状)
    • url
    • auto
    • crosshair
    • default
    • pointer
    • move
    • e-resize
    • ne-resize
    • nw-resize
    • n-resize
    • se-resize
    • sw-resize
    • s-resize
    • w-resize
    • text
    • wait
    • help
    4 1 6 2
    display 设置如何及是否显示某元素
    • none
    • inline
    • block
    • list-item
    • run-in
    • compact
    • marker
    • table
    • inline-table
    • table-row-group
    • table-header-group
    • table-footer-group
    • table-row
    • table-column-group
    • table-column
    • table-cell
    • table-caption
    4 1 4 1
    float 设置图像或文本出现于另一元素中的何处
    • left
    • right
    • none
    4 1 4 1
    position 元素的定位方式:静态、相对定位、绝对定位、固定定位
    • static
    • relative
    • absolute
    • fixed
    4 1 4 2
    visibility 设置元素可见或不可见
    • visible
    • hidden
    • collapse
    4 1 6 2

    CSS 定位属性 (Positioning)

    属性 描述 IE F N W3C
    bottom 设置元素的底边距离其父元素的底边之上或之下的距离。
    • auto
    • %
    • length
    5 1 6 2
    clip 设置元素的形状。元素被剪入这个形状之中,然后被显示出来。
    • shape
    • auto
    4 1 6 2
    left 设置元素的左边与其父元素的右边或左边的的距离。
    • auto
    • %
    • length
    4 1 4 2
    overflow 设置当元素内容溢出其区域时如何对内容进行管理
    • visible
    • hidden
    • scroll
    • auto
    4 1 6 2
    position 将元素放置于静态、相对、绝对或固定的位置
    • static
    • relative
    • absolute
    • fixed
    4 1 4 2
    right 设置元素的右边距父元素右边的左侧或右侧的距离
    • auto
    • %
    • length
    5 1 6 2
    top 设置元素的顶边距父元素的顶边的上方或下方的距离
    • auto
    • %
    • length
    4 1 4 2
    vertical-align 设置元素的垂直排列。
    • baseline
    • sub
    • super
    • top
    • text-top
    • middle
    • bottom
    • text-bottom
    • length
    • %
    4 1 4 1
    z-index 设置元素的堆叠顺序
    • auto
    • number
    4 1 6 2

    伪类

    伪类 作用 IE F N W3C
    :active 将样式添加到被激活的元素 4 1 8 1
    :focus 将样式添加到被选中的元素 - - - 2
    :hover 当鼠标悬浮在元素上方时,向元素添加样式 4 1 7 1
    :link 将特殊的样式添加到未被访问过的链接 3 1 4 1
    :visited 将特殊的样式添加到被访问过的链接 3 1 4 1
    :first-child 将特殊的样式添加到元素的第一个子元素   1 7 2
    :lang 允许创作者来定义指定的元素中使用的语言   1 8 2

    伪元素

    伪类 作用 IE F N W3C
    :first-letter 将特殊的样式添加到文本的首字母 5 1 8 1
    :first-line 将特殊的样式添加到文本的首行 5 1 8 1
    :before 在某元素之前插入某些内容   1.5 8 2
    :after 在某元素之后插入某些内容   1.5 8 2
    原文地址:https://www.cnblogs.com/Tonyyang/p/1042574.html