CSS has a ancestor-descendant relationships. Anything previously defined by an ancestor will automatically be inherited by one of its children unless otherwise specified. If an element is defined in more than one place within CSS, the last definition overrides the previous.
Full article