[精通CSS与HTML设计模式]读书笔记之CSS中被人忽视的继承关系

  大家用过css,继承虽然大家都知道,但是真正知道那些东东是,会继承过来的,那些是不会 "子承父业" 的.现在,就告诉大家哈.[小贺  有错误的地方请大家指出,不胜感激!]

  在设计css的时候,很多  属性 都是可以继承的.

  1.可继承的属性:

  >>>visibility 和  cursor 可以被所有元素继承

  >>>以下只可被 内联元素 继承 : letter-spacing(伪类里的), word-spacing,white-space,line-height,color,[font家族]font,font-familly,font-weight,font-size,font-style,font-variant,font-decoration,text-transform,direction

  >>>以下属性会被 块级元素 继承: text-align 和 text-indent

  >>>以下属性会被 列表元素继承: list-style,list-style-type,list-style-position,list-style-image

  >>>以下属性会被 表格元素继承: border-collapse

  2.不可继承的属性

  >>>以下属性不可被继承:

  display,margin,border         padding,background,height           min-height,max-height,width       min-width,max-width,overflow    position,left,right,top,bottom     z-index,float,clear      table-layout,vertical-align,page-break-after,pager-break-before和unicode-bidi[这里有几个我们都没见过,估计用的不多吧]

原文地址:https://www.cnblogs.com/NetSos/p/1814286.html