Simple element mapping

As previously described, defining a style rule for a given element requires specification of the element name (the selector), followed by a set of declarations:

head1   { font-size: 32pt ; color: blue }

More than one rule may be defined for each element. Providing that the declarations do not conflict, they simply accumulate as if they had been defined in a single rule. The example below is functionally identical to the less verbose version above:

head1   { font-size: 32pt }
head1   { color: blue }

When separate rules do conflict, the last rule in the stylesheet applies. In the following example, the Head1 element is displayed in green:

head1   { font-size: 32pt ; color: blue }
head1   { color: green }

Importance override

Get XML Companion, The, Third 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.