CSS可继承与不可继承属性


字体属性

  • 可继承属性
    font-family
    font-size
    font-variant
    font-weight
    font

font-size继承的是计算后的实际值

文本属性

  • 可继承属性
    word-spacing
    letter-spacing
    text-align
    text-indent
    line-height
  • 不可继承属性
    text-decoration
    vertical-align

颜色背景属性

  • 可继承color
  • 不可继承background(background-color background-image background-repeat background-attachment background-position)

边框属性

不可继承border(border-top border-right border-bottom border-left)(border-width border-style border-color)

定位和布局属性

  • 不可继承
    margin
    padding
    width
    height
    float
    clear
    position
    left
    top
    overflow
    z-index
    display

列表属性

  • 可继承
    list-style-image
    list-style-position
    list-style-type
    list-style

你可能感兴趣的:(CSS可继承与不可继承属性)