There are five types of selectors they are,
Tag name selector: It is also called as 'Element selector'.It applies the CSS for all the tags specified in the CSS file.
Id selector: It is basically preferred only if CSS has to apply on only one Html tag.The rules to be followed for Id Selector are
Note : Since Id selector applies only for one Html tag hence it is also called as Unique Selector .
Class selector: It is used to apply the CSS for more than one tag but for all tags.The rules to be followed to work with class selector are,