CSS: Is there a limit on how many classes an HTML element can have?

前端 未结 4 441
一向
一向 2020-12-29 21:09

CSS allows an HTML element to have multiple classes:

Nibbles

But is there a limit

4条回答
  •  轮回少年
    2020-12-29 21:42

    No. I don't think, I have ever come across any such limit/

    EDIT: Sorry for the casual remark.
    According to the specifications, there isn't any limit but someone has tried to reach this limit and it seems the limit for Opera, Safari supported well over 4000 classes, and Firefox at least 2000 classes!
    Source: http://kilianvalkhof.com/2008/css-xhtml/maximum-number-of-supported-classes-per-element/

提交回复
热议问题