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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.