How do you use CSS to put a background picture in XML file?

I have a reference to the background on my xml document, but I dont know how to use CSS to set that image as a background

The code in my XML document is:

<background>image.jpg</background>

Thanks for your help


3 Responses to “How do you use CSS to put a background picture in XML file?”

  • Andrew S:

    With out some server side code, you couldn’t specify the background with just a tag in the document.

    Include this at the top of the XML document.

    <?xml-stylesheet href="common.css" type="text/css"?>

    In common.css style the 1st Parent in your XML Document the same way you would style the body tag.

    In fact you could even use <body> if you so wished!

    tag {
    background-url:url(image.jpg);
    }

  • eric22vhs:

    body
    {
    background: url(images/web2bkrnd.jpg) top left;
    background-attachment:fixed;
    }

    is css

  • randyemanio:

    Consider the XML specification below:
    <?xml version="1.0" ?>
    <!DOCTYPE people SYSTEM "personnel2.dtd">
    <?xml:stylesheet type="text/css" href="personnel2.css"?>
    <people>
    <person>
    <female>Celia Larkin</female>
    </person>
    <person>
    <male>Bertie Ahern</male>
    </person>
    </people>
    This refers to a CSS style-sheet

    The contents of the CSS file personnel2.css are:
    male {color : blue; background-color : orange}
    female {color : pink; background-color : green}

Leave a Reply