Using Inline Styles

As mentioned earlier, you can also create inline styles using the STYLE attribute, if the browser you're using understands that attribute in XML documents. Using the STYLE attribute, you can specify a rule directly. For example, here's how I style the <U> element used in the previous example using the STYLE attribute:

<?xml version="1.0" standalone="yes"?> 
<?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 STYLE="text-decoration: underline">Verus</U>, I learned good morals and the government of my temper. </P> <P> From the reputation and remembrance of my father, modesty and a manly character. ...

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.