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

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