css继承性和不继承的属性。

在CSS中并不是所有的属性都是能够继承的,因此在使用时一定要了解哪些是能够继承的哪些是不能够继承的。

visibility和cursor能够被所有元素继承;letter-spacing,word-spacing,white-space,line-height,color,font,font-family,font-size,font-style,font-variant,font-weight,text-decoration,text-transform,direction能够被内联元素继承;text-indent和text-align会被终端元素继承;list-style,list-style-type,list-style-posi-tion,list-style-image会被列表元素所继承;border-col-lapse会被表格元素所继承[2]。

以下属性是不可继承的:border,height,display,margin,background,padding,min-height,overflow,max-height,width,min-width,max-width,position,right,top,left,bottom,float,z-index,clear,table-lay-out,ertical-align,nicode-bidi,age-break-after,age-break-before。