The context to which a style rule applies depends on inheritance , specificity , and the cascade .
Inheritance depends on document structure .
Specificity has to do with the nature of the selector . The cascade has to do with conflicts between multiple style sheets . Inheritance flows from higher to lower levels in the tree or outline of the document structure. Hence this paragraph has the same background color as its parent body. Inheritance fails deliberately when common sense informed the creators of CSS that it would be ugly, inconvenient, or otherwise undesirable for inheritance to apply.