Can I use non existing CSS classes?

后端 未结 13 2001
北荒
北荒 2020-11-27 12:54

I have a table where I show/hide a full column by jQuery via a CSS class that doesn\'t exist:

13条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 13:46

    There are no ill effects to use classes which don't have styles. Indeed, that's part of the usefulness of CSS is that it's de-coupled from the markup and can style or not style elements/classes/etc. as needed.

    Don't think of them as "CSS classes." Think of them as "classes" which CSS happens to also use if it needs to.

提交回复
热议问题