Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book