Home >Web Front-end >Front-end Q&A >What are the properties of css that do not inherit from the parent class?
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-increment4. Box model attributes:
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-left5. Outline style attributes:
outline-style、outline-width、outline-color、outline6. Page style attributes:
size、page-break-before、page-break-after7. Background attribute:
background、background-color、background-image、background-repeat、background-position、background-attachment8. Positioning attribute:
float、clear、position、top、right、bottom、left、min-width、min-height、max-width、max-height、overflow、clip、z-index9. Sound style attribute:
pause-before、pause-after、pause、cue-before、cue-after、cue、play-during(Learning video sharing:
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!