Reputation: 11
When passing classes into HTML, I was wondering how many classes per element is considered a 'best practice'?
For instance, would;
<nav class="navbar navbar-inverse navbar-fixed-top nav-justified box-shadow navbar-height"> </nav>
be viewed as incorrect practice?
Upvotes: 1
Views: 36
Reputation: 4289
There is no limit of classnames used in your html tag, it only affects the readability of your code and it can depends on your team or company code-style rules.
Otherwise, you should to rethink your code organisation if you're used to write a new class for each property. Even Facebook or other giant apps are use ~10 classes max, and usually it's not more than 5.
Upvotes: 1