CSS inherit keyword
Examples
Settings <span> element text color is blue, except those class = "extra" elements:
span
{
color: blue;
}
.extra span
{
color: inherit;
}
{
color: blue;
}
.extra span
{
color: inherit;
}
try it"
Browser Support
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
inherit | 1.0 | 8.0 | 1.0 | 1.0 | 4.0 |
Definition and Usage
inherit property keyword specifies a parent element should inherit its value.
Keywords can be used to inherit any CSS property of any HTML element.
version: | CSS3 |
---|---|
JavaScript syntax: | object .style. property = "inherit"a try |
CSS Syntax
property : inherit;
related articles
CSS initial keyword: Initial Keyword