O'Reilly logo

Web Technology: Theory and Practice by M. Srinivasan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.4 SELECTORS

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required