O'Reilly logo

Real World XML by Steven Holzner

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

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

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