BEM: Block-Element-Modifier

Docs:

https://en.bem.info/

What is BEM?

BEM is a naming convention for CSS classes that gives meaningful, specific, and maintainable class names. Quite often, we can have a webpage with a lot of HTML and it can be quite difficult to find appropriate CSS class names.

In the BEM model, a CSS class can be broken down into at most three parts: * Block * Element * Modifier

By using BEM, we are able to keep all styles at the same level of specificity, with no style overriding the other due to being a higher level of specifity.

However, not all three parts must be present in the class name.

What are blocks, elements and modifiers?