user3495807
user3495807

Reputation: 11

How many classes would be considered 'poor practice'

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

Answers (1)

flppv
flppv

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

Related Questions