BEM: Block Element Modifier Naming
Apply the Block-Element-Modifier methodology to create predictable, reusable class names.
What is BEM?
BEM (Block–Element–Modifier) is a naming convention that creates self-describing class names. It makes CSS components predictable and self-documenting.
Block
A Block is a standalone, meaningful UI component that can exist independently. It is the root class of the component.
/* Blocks: */
.card { }
.nav { }
.button { }
.search-form { }All lessons in this course
- Why CSS Architecture Matters
- BEM: Block Element Modifier Naming
- File Organization: ITCSS and 7-1 Pattern
- Avoiding Specificity Wars