kebab-case
Example: main-container
, btn-primary
- Suitable for CSS and HTML, as classes and IDs cannot contain spaces.
- Highly readable within files.
- Also used for file names.
Practical example
Section titled “Practical example”<div class="main-container"></div>
.main-container { padding: 20px;}
Advantages: readable, web-friendly.
Disadvantage: cannot be used in JS (the -
is interpreted as a subtraction operator).