Chapter fourth saving time with style inheritance
I. The role of inheritance: simplifying style sheets
Ii. commonly used attributes that can be inherited and cannot be inherited
(1) Non-inheritable: 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 and Unicode-bidi.
(2) All elements can be inherited: visibility and cursor.
(3) Inline elements can be inherited: 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.
(4) terminal block elements can be inherited: Text-indent and Text-align.
(5) List elements can be inherited: List-style, List-style-type, List-style-position, List-style-image.
(6) The table element can inherit: Border-collapse.
The fifth chapter uses the Cascade management style
One, when the inherited attribute conflicts
(1) The most recent ancestor style wins
(2) style attributes that are specifically applied to labels prevail over all inherited properties
If the a tag uses their own preset style, does not inherit from the parent element inherits from the style
(3) Use weights to determine that style wins
Tag Selector 1 points
Class selector 10 min
ID selector 100 points
Built-in style 1000 points
(4) The right value is the same as the last style wins
Second, control cascade
(1)!important
(2) Change the weight value
For example:
. Intro weight value is 10
#sidebar p weight value is 101
#sidebar. Intro weight value is 110
(3) Selective coverage
CSS3 Book notes 2015/12/6