My enterprise would be that since hyphens are rarely used for variable names, class names, method names, etc., out of habit developers use underscores when naming in HTML and CSS.
I do not believe that in any case there is any agreement. Just a preference.
source share