Problem Statement
Explain how inheritance works in CSS.
Explanation
Inheritance in CSS means some properties are automatically passed from parent elements to their children. For example, text color and font family are inherited, but box-related properties like margin or padding are not. You can use the 'inherit' keyword to force a property to take its parent’s value.
Code Solution
SolutionRead Only
p { color: inherit; }Practice Sets
This question appears in the following practice sets:
