这种问题一般都是根据经验积累的吧,没看到有官方的文档,倒是从网上搜到一份,供参考。 不可继承的: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。 http://blog.163.com/yhwwen@126/blog/static/170468853201326421822/
找到两份资源可以参考一下的, 可能还更精确一点:http://www.w3.org/TR/CSS21/propidx.htmlhttp://stackoverflow.com/questions/5612302/which-css-styles-are-inherited
这种问题一般都是根据经验积累的吧,没看到有官方的文档,倒是从网上搜到一份,供参考。
不可继承的: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。
http://blog.163.com/yhwwen@126/blog/static/170468853201326421822/