Selectors can be defined based on an element's type, its class or, ID attribute, even how we interact with the element and more. But before we get into how CSS selectors work, let's first talk about what makes up a CSS rule.

CSS rules or rule sets, tell browsers how to render HTML elements. A CSS rule is made up of two main parts, as you’ve already seen: the selector followed by the declaration block.