5.3. Selectors

You usually define style rules by placing an entry of the following form in the STYLE element:

						selector { property1:
						value1; ... ; propertyN:
						valueN }

Up to this point, we have only given examples where the selector was an HTML element name, indicating that the rule should be applied to all elements of that type unless overridden in the element declaration itself. For instance, to specify that strongly emphasized text be rendered in bold with a 50% increased font size, you could use:

STRONG { font-weight: bold; font-size: 150% }

Although HTML elements are a common selector type, they are not the only option. The cascading style sheet standard allows a variety of selector types to define formatting rules that apply only in certain ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

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