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

后端 未结 5 2027
暗喜
暗喜 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:33

    The HTML 5 Specification lifts this restriction. If you're worried about validity you might simply consider changing the DTD to HTML5's.

    http://www.w3.org/TR/html5/elements.html#the-id-attribute

提交回复
热议问题