Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox not loading CSS background image with XSL

Status
Not open for further replies.

dougalim

Programmer
Mar 1, 2007
23
US
I have a simple HTML document like this rendered in Firefox and IE, it works with the background image:

Code:
<html>
<head>
<style>
body { background-image:url('background.jpg'); }
</style>
</head>
<body>
Page contents
</body>
</html>


But if I combine this xml:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<root>
  <tag>Page contents</tag>
</root>

with this xsl, IE renders the background image, but Firefox does not:

Code:
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>[/URL]
<xsl:template match="/">

<html>
<head>
<style>
body { background-image:url('background.jpg'); }
</style>
</head>
<body>

<xsl:for-each select="root/tag">
<xsl:value-of select="."/>
</xsl:for-each>

</body>
</html>

This is very frustrating. Does anyone know why or how to make it work. I have tried an external style sheet with the same result.
 
[0] No need to quote around url.
body { background-image:url('background.jpg'); }
[tt]body { background-image:url(background.jpg); }[/tt]

[1] >with this xsl, IE renders the background image, but Firefox does not:
Cannot reproduce the problem stated (ff2.0).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top