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

Using Inheritance

You might have noticed that although the <U> element in the previous examples specified only one aspect of the element's style—that is, that text should be underlined (by using this rule: U {text-decoration: underline})—the underlined text appeared in the same font as the surrounding text, as you see in Figure 9-7. The reason is that styled elements inherit the styles of their parent elements. In this case, the <U> element's parent element is <P>:

<?xml-stylesheet type="text/css" href="ch09_02.css"?> 
<DOCUMENT>
    <TITLE>The Meditations</TITLE>
    <AUTHOR>By Marcus Aurelius</AUTHOR>
    <SECTION>Book One</SECTION>
    <P>
        From my grandfather, <U>Verus</U>, I learned good morals and the government of my temper. </P> <P> From the reputation ...

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