# Inheritance & the Cascade — CSS

Source: https://www.geekswithgeeks.com/en/css/css-inheritance-cascade

> Which properties pass down to children, and the full conflict-resolution order.

## What inherits

Text-related properties like `color`, `font-family`, `font-size`, and `line-height` **inherit** from parent to child automatically. Box properties like `margin`, `padding`, and `border` do **not**.

## The cascade order

When rules conflict, the browser checks in order: **origin & importance** (author styles vs `!important`), then **specificity**, then **source order** — the last rule of equal specificity wins.

## Avoid !important

`!important` overrides normal specificity and is hard to undo later — reach for a more specific selector or reorganize CSS instead of reaching for `!important`.
