CSS rules (CSS Declarations) that are defined, are applied to individual HTML tags as per pattern matching rules. The patterns are defined in CSS as Selectors. They are many types of them, classified by their mode of application, that is, Styles that are defined are applied to a specific selection, identified by a Selector or group of Selectors. A simple selector is the Type Selector. For example, consider the following directive.

div {font-size: 1em;}

It matches all elements with <div> tag in the HTML form. After matching, it applies the style(s) indicated in the CSS Declaration block. In this case, a font size of 1 em is the style applied. This is the most straight-forward type of selector to understand. Now let us move on to ...

Get Web Technology: Theory and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.