CSS class and id with the same name

前端 未结 4 1098
暗喜
暗喜 2020-12-07 22:29

Is there anything wrong with having a css class and id with the same name? Like .footer for the article/post\'s footer and #footer for the page footer.

4条回答
  •  时光取名叫无心
    2020-12-07 23:12

    No, there is nothing wrong, but it might be better to use different names to not confuse other developers. It is more (human) error prone to use different names.

提交回复
热议问题