0

why do people use " - " between their words instead of " _ " for example class ="btn-submit", isn't this inefficient? if you use "_" by double-clicking it will select the whole class name instead of only one side so copying and using it in CSS or javascript will be easier. double click on each of these below to see the difference

class ="btn-submit"

class ="btn_submit"

so there is any specific reason to do it that way or it's just something that is people using by bad habit.

alireza
  • 101
  • 11
  • 1
    half related: https://stackoverflow.com/questions/20811509/why-hyphen-separated-class-names-are-widely-used-in-css or this https://stackoverflow.com/questions/36710166/css-trends-with-naming-class-and-id-with-dash-underscore/36710323 – Nina Scholz Feb 12 '22 at 22:27
  • I suspect that people who do that all the time don't think it's a bad habit. – Pointy Feb 12 '22 at 22:31

0 Answers0