CSS inheritKeywords
Example
Set the text color of <span> elements to blue, except for those with class="extra":
span
{
color: blue;
}
.extra span
{
color: inherit;
}
Try it Yourself »
Browser Support
The numbers in the table indicate the first browser version number that supports the property.
| Property | |||||
|---|---|---|---|---|---|
| inherit | 1.0 | 8.0 | 1.0 | 1.0 | 4.0 |
Definition and Usage
The inherit keyword specifies that a property should inherit its value from its parent element.
The inherit keyword can be used on any CSS property on any HTML element.
| version: | CSS3 |
|---|---|
| JavaScript Syntax: | object.style.property="inherit" Try it Yourself |
CSS Syntax
property: inherit;
Related Articles
CSS initial keyword:initial keyword
other extensions