CSS中可以和不可以继承的属性

CSS样式中不是全部的属性都是可以被子元素继承的,下面列出 CSS中可以和不可以继承的属性。

不可继承的:

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、 page-bread-before和unicode-bidi。

 

所有元素可继承:  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-position、list-style-image。

表格元素可继承:border-collapse。

posted on 2016-09-01 14:25  dataman  阅读(394)  评论(0编辑  收藏  举报

导航