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. Using a group selector in a stylesheet.

graphics/09fig03.gif



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net