CSS inherit Keyword | CSS References
Example
Set the text-color for <span> elements to blue, except those inside elements with class=”extra”:
span {
color: blue;
}.extra span {
color: inherit;
}
Definition and Usage
The inherit keyword specifies that a property should inherit its value from its parent element.
The inherit keyword can be used for any CSS property, and on any HTML element.
| Version: | CSS3 |
|---|---|
| JavaScript syntax: | object.style.property=”inherit” Try it |
CSS Syntax
property: inherit;
