CSS attributes that do not inherit from the parent class include: display, width, height, margin, border, float, clear, position, top, right, bottom, left, background, content, size, etc.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
CSS inheritance is a rule that allows styles to be applied not only to a specific html tag element, but also to its descendants; that is: if the CSS style of the superior (parent) is set, the superior (parent) level) and the children below (subordinates) have this style.
The role of css inheritance: set some attributes for the parent element, which can also be used by child elements.
CSS inheritance means that the tags wrapped inside will have the style properties of the outer tags. The most typical application of the inheritance feature is usually used in the style default of the entire web page, and the parts that need to be designated as other styles can be set in individual elements. This feature can provide web designers with more ideal space to play. But at the same time, inheritance also has many rules, which can be confusing when applied.
So what are the properties of css that do not inherit from the parent class?
1. Text attributes:
content、counter-reset、counter-increment
width、height、margin 、margin-top、margin-right、margin-bottom、margin-left、border、border-style、border-top-style、border-right-style、border-bottom-style、border-left-style、border-width、border-top-width、border-right-right、border-bottom-width、border-left-width、border-color、border-top-color、border-right-color、border-bottom-color、border-left-color、border-top、border-right、border-bottom、border-left、padding、padding-top、padding-right、padding-bottom、padding-left
outline-style、outline-width、outline-color、outline
size、page-break-before、page-break-after
background、background-color、background-image、background-repeat、background-position、background-attachment
float、clear、position、top、right、bottom、left、min-width、min-height、max-width、max-height、overflow、clip、z-index
pause-before、pause-after、pause、cue-before、cue-after、cue、play-during
css video Tutorial)
The above is the detailed content of What are the properties of css that do not inherit from the parent class?. For more information, please follow other related articles on the PHP Chinese website!