The Problem: CSS Gets Messy
Small sites are easy. Big sites grow rules that fight each other, names nobody understands and styles nobody dares to delete. A naming system and structure keep it healthy.
BEM Naming
BEM = Block, Element, Modifier. It gives every class a clear role.
| Part | Pattern | Example |
|---|---|---|
| Block | .block | .card |
| Element | .block__element | .card__title |
| Modifier | .block--modifier | .card--featured |
Utility-First CSS
Instead of writing custom CSS for each component, you combine many small single-purpose classes in the HTML.
Bootstrap vs Tailwind
| Bootstrap | Tailwind CSS | |
|---|---|---|
| Style | Ready-made components (navbar, modal, card) | Utility classes you combine |
| Speed to first result | Very fast, looks 'Bootstrap-like' by default | Fast once you learn the classes |
| Customization | Variables and overrides | Very flexible, design from scratch |
| HTML | Fewer classes per element | Many classes per element |
| Best for | Dashboards, prototypes, quick sites | Custom designs and component systems |
Reset and Base
Scalable Structure
Rules of Thumb
- One component, one file
- Style with classes, not tags or ids
- Keep selectors short (one or two levels)
- Use variables for colors and spacing
- Delete unused CSS regularly
- Do not use
!importantas a habit
Practice
- Rewrite a messy card style using BEM
- Build the same button with plain CSS and with a utility approach
- Create the folder structure for your project
Conclusion
Use clear names (BEM or utilities), a short reset, shared tokens and a folder structure. Learn plain CSS first, then add a framework when it helps.

