Can I use camelCase in CSS class names

前端 未结 4 2294
轮回少年
轮回少年 2020-12-01 05:30

I want to name a CSS class and call it imgSuper. Can I use camelCasing in CSS classes?

4条回答
  •  爱一瞬间的悲伤
    2020-12-01 05:51

    Yes, class names are case sensitive, so that works fine.

    However, you should be aware that some browsers get this wrong, and don't treat class names as case sensitive. Therefore you should avoid using both the upper and lower case variations of the same name. The classes imgSuper and imgsuper may be treated as the same by some browsers.

提交回复
热议问题