I have seen some developers write
HTML:
some content
CSS:
Does this mean this style will be applied only when the class is applied to a div ?
Yes
The previous rule will not in deed have any effect on span
The reason for such choice depends on the context. In general, any css style is to focus on a particular element on a given page otherwise you will have
div { .... }