Grouping Elements in Selectors

Another way of creating an element selector in a style rule is to list a number of elements, separated by commas. The same rule will apply to the whole group of elements, as in this case, where I'm styling the <TITLE> and <AUTHOR> elements the same way:

Listing . ch09_04.css
					TITLE, AUTHOR {display: block; font-size: 24pt; font-weight: bold;
					text-align: center; text-decoration: underline}
SECTION {display: block; font-size: 16pt; font-weight: bold;
text-align: center; font-style: italic}
P {display: block; margin-top: 10}

You can see this stylesheet applied to the XML document we've been using in Figure 9-3. As you see in that figure, the <TITLE> and <AUTHOR> elements are indeed styled the same way.

Figure 9-3. ...

Get Real World XML 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.