Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS inherit keyword

CSS inherit keyword

CSS Reference Manual CSS Reference Manual

Example

Settings The text color of the elements is blue, except for those with class="extra":

span

{

color:

blue

;

}

.extra

span

{

color:

inherit

;

}

Try it »


Browser support

The numbers in the table indicate the first browser version that supports this 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 with any CSS property on any HTML element.

Version: CSS3
JavaScript syntax: object.style.property="inherit" Try it

CSS Syntax

property

: inherit;


Related Articles

CSS initial Keyword:initial keyword

CSS Reference Manual CSS Reference Manual