Skip to content

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.
<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).