Home › CSS Tutorial › CSS inheritance
CSS inheritance
What passes from parent to child.
Text properties such as color and font-family inherit. Box properties such as border do not. Force it with inherit, initial or unset.
Commands in this lesson
color
Definition: Sets the text color.
Syntax:
color: value;
Example:
color: crimson;Example code
<style>
section{color:crimson;border:2px solid #888}
section p{border:inherit}
</style>
<section><p>Color inherited, border forced</p></section>