In CSS, inheritance is the mechanism used to propagate the property values from parents to children.
Styles assigned to an element are inherited by all its descendants (i.e., nested elements), if not explicitly overridden. For example, you can set the font size and color for
body, and all the nested elements will have this very size and color.
Inheritance helps you to reduce your style sheet size, but if you have many styles, it is not so easy to track which ancestor element has propagated a given property.
- For all the text on the site, set the font color as
color: #2980b9;and the font size as
- Override the color of the list items with