If you need to give a few things to an attribute / style, use a class, if it is singular, use an identifier. If this is what I want to readily identify, for example LoginBtn , then this is an identifier, if it is a style, for example, an anchor that is blueLink , this is a class.
Another consideration for many developers is javascript. for example, the jQuery $('#id') selector is much faster than $('.class') , so if you are dealing with only one element, this is also an advantage.
source share