The value inherit keyword is used to inherit a property to an element from its parent element property value. The inherit keyword can be used for inheriting any CSS property, and on any HTML element.
Inheritance is always from the parent element in the document tree, even when the parent element is not the containing block.
Example 1: Inheriting the font size from the parent element.
Example 2: Inheriting the color from the parent element.
- Inherit a class to another file in Sass
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | Percentage Value
- CSS Value | Angle
- CSS | [attribute$=value] Selector
- CSS | [attribute=value] Selector
- CSS | [attribute*=value] Selector
- CSS | [attribute|=value] Selector
- CSS | [attribute~=value] Selector
- CSS | [attribute^=value] Selector
- CSS Value Resolution
- CSS | Value Integer
- CSS Value | Unset
- CSS Value | Initial
- CSS Value Time
- CSS Value String
- CSS Ratio Value
- CSS Frequency Value
- How to get hex color value of RGB value ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.