liveBook · Manning

BEM

BEM, or Block-Element-Modifier, is a CSS naming methodology that organizes classes around reusable blocks, their elements, and their modifiers.

How 2 Manning books explain it

CSS in Depth, Second Edition

Block-Element-Modifier is the expanded name of the BEM CSS naming methodology.

How it is used
Organizes CSS modules with class names that identify their parts and variants in component and page markup.
How deep it goes
Defines block, element, and modifier names, then works through variants and subelements without requiring strict use of every convention.
Examples
Demonstrates message variants, combinable button modifiers, and a multi-element media module with a reversed-layout variant.
What you can do after
Practice/perform it by naming module parts and applying variant classes alongside their base classes.

Read how CSS in Depth, Second Edition explains BEM →

Tiny CSS Projects

BEM is a component-based CSS architecture that organizes interfaces into blocks, elements, and modifiers.

How it is used
Organizes reusable component styles and reduces naming collisions when CSS is not automatically scoped.
How deep it goes
Defines blocks, elements, and modifiers, then applies them to an interactive share component without treating BEM as a complete CSS system.
Examples
Uses a social-media share component with share, share__menu, share__button, and share_expanded classes.
What you can do after
Apply BEM to name and style reusable interface components with explicit structural and state-related classes.

Read how Tiny CSS Projects explains BEM →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.