The three levels of CSS define so many properties, I can’t cover them all here. There are over 120 in level 2 alone. Instead, I’ll cover the basic categories you are likely to encounter and leave more exhaustive descriptions to books specializing on the topic.
CSS properties can be passed down from a container element to its child. This inheritance principle greatly simplifies stylesheet design. For example, in the document element rule, you can set a font family that will be used throughout the document. Wherever you want to use a different family, simply insert a new property for a rule and it will override the global setting.
In Figure 5-9, a
para inherits some properties from
section, which in turn inherits
article. The properties
color are defined in the property set for
article, and inherited by both
para. The property
font-size is not inherited by
section’s explicit setting overrides it.
para does inherit this property
Inheritance is forbidden for some properties where it wouldn’t
make sense to pass that trait on. For example, the
background-image property, which causes an image to be loaded and displayed in the background, is not inherited. If every element did inherit this property, the result would be a complete mess, with every paragraph and ...