My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Why do you prefer what you prefer? CSS class names: Hyphenated, camelCase or any other style?

Karan Sharma's photo
Karan Sharma
·May 25, 2017

Just wanted to hear opinions of many developers as to why they prefer to write classnames in a particular style. Here are the options:

Hyphenated: .my-first-div

Camel Case: .myFirstDiv

No style: .myfirstdiv

If I have missed any style, please mention it and explain why you use it.

PS: I don't opinions on which is better. The question is why do you prefer a particular style of writing className. :)