/

HTML / CSS / JavaScript Tutorial

CSS Keyword: inherit

[this page | pdf | back links]

The CSS (CSS3) inherit keyword is used to specify that an element should inherit its value from its parent element.

 

For example, the following means the color property for <span> elements should be red, except for those which have class = "colorinherited", which would inherit theirs from their parent element

 

Example rule:

span {color: red; }

span.colorinherited {color: inherit;}

JavaScript syntax:

e.g. object.style.property="inherit"

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile