CSS Specificity
intermediateDefinition
The browser's rule for deciding which style wins when two CSS rules try to style the same thing: the more precisely a rule points at an element, the more weight it carries.
In the wild
A new rule makes all links blue, but an older rule aimed only at links in the navigation bar makes them red, and because it is more specific the navigation links stay red.
More from Layout & Responsive Design
Accessibility (a11y)
Making websites and apps usable by everyone, including people who are blind, have low vision, are color-blind, or can't use a mouse.
ARIA (Accessible Rich Internet Applications)
Extra labels added to a page's HTML that tell screen readers (software that reads a page aloud) what a custom element is and what it's doing, such as "this is a menu and it's open".
Box Model
The way a browser treats every item on a web page as a box with four layers: the content, padding around it, a border, and a margin that keeps it apart from its neighbors.
Breakpoint
A screen width at which a web page switches to a different layout, such as from one column on phones to three columns on desktops.
CSS Grid
A CSS tool for laying out items in rows and columns at the same time, like cells in a spreadsheet.
CSS Variables (Custom Properties)
Named values, such as a brand color or a standard amount of spacing, that are defined once in CSS and reused across a whole site, so changing one place updates everywhere.