← Back to CoursesWeb Design & Development: Intermediate

Neuroanatomy Explorer

Drag to rotate · scroll to zoom · click regions to explore

View
Loading 3D model…

Click a region
to explore it

Memory Deck

Flip each card and rate whether you knew it. Your score is saved.

Term
Definition

Deck complete — score saved.

Match the Pairs

Match each term to its definition. Finish the board to earn your score.

All matched — score saved.

Concept Constellation

Every key idea in this course, mapped as an explorable 3D constellation. Drag to rotate, scroll to zoom, click a node.

Click a node to read its definition.

CSS Fundamentals: The Cascade, Specificity, and Inheritance

Manual: General · Subject: Web Design & Development

Build a deep mental model of how CSS rules are chosen and applied.

How CSS decides what wins

Cascade basics

When multiple CSS rules target the same element, the browser resolves conflicts using origin, importance, specificity, and source order. This is the cascade, and understanding it is essential for debugging styling issues.

ℹ️

Specificity mental model

Inline styles generally outrank selectors, IDs outrank classes, classes outrank element selectors, and later rules can win when specificity ties.

Inheritance and defaults

Inherited vs non-inherited properties

Some properties such as font−familyfont-family and colorcolor inherit from parent elements, while others like marginmargin and borderborder usually do not. Browsers also apply default styles, so a reset or normalization strategy can help create a consistent baseline.

Selector strategy

Prefer selectors that are simple, reusable, and easy to override. Heavy reliance on IDs and deeply nested selectors often creates brittle code and makes component styling harder to manage.

Which rule usually has higher specificity?

What does CSS inheritance mean?

💡

Debugging tip

When a style seems ignored, inspect specificity and source order before assuming the property is invalid.

Name one property that commonly inherits from a parent.