Is it always bad practice to start an ID with a number? (CSS)

后端 未结 5 2030
暗喜
暗喜 2020-12-20 15:54

In my project I have submissions and comments, each with an ID. Currently the ID\'s are just numeric and correspond to their database ID\'s. Everything is working fine but w

5条回答
  •  温柔的废话
    2020-12-20 16:45

    The best way for your need is having the prefix for your class, I mean something like item-x and x is the number that you need.

    But from my personal experience, it is better to use classes for your elements, and you know that you must use classes if the item is not unique in the page

提交回复
热议问题