Apr 05

Have you ever gone along coding your front end, adding multiple classes to a single element, and then stop to consolidate because you feared you added a class too many? I know that I have at least paused to reconsider. <div class="related bug show nojs"> just seems to be reaching the limits of what my browser could handle.

Well, fear no more. Using JavaScript, Kilian Valkhof has uncovered a relieving (and surprising) conclusion. I don’t want to steal his thunder, but there is nothing to worry about; add all the classes you want.

2 Responses to “Maximum CSS Classes”

  1. Tony Says:

    I have wondered about that myself. The most I’ve used is five.

    I remember when I first realized that multiple classes could be applied. It made my head explode. And I’ve been taking advantage of it ever since (the multiple classes, not the head explosion).

  2. Jennifer Says:

    Same exact feeling here. Life is full of possibilities.

Leave a Reply




  • Meta