Skip to main content
Inspiring
August 9, 2011
Question

td background vs. body background

  • August 9, 2011
  • 1 reply
  • 508 views

Hi,

I want the page to have the image background but why 1 is worked and 2 isn't, please explain?

1. image is displayed

<td background="#imageDirPath#/images.cfm?test_1.jpg"></td>

2. image is not displayed

<body background="#imageDirPath#/images.cfm?test_1.jpg">"></body>

3.

<style>
.slide1
{
background-image:url(images/test_1.jpg);
width:769;
height:573;

}

is there the way to call the background-image:url(images/test_1.jpg) from style to call the imageDirPath#/images.cfm?test_1.jpg?

image.cfm

<cfcontent file="#GetDirectoryFromPath(GetCurrentTemplatePath())#images/#CGI.QUERY_STRING#" type="image" deletefile="No">

thanks

This topic has been closed for replies.

1 reply

Participating Frequently
August 9, 2011

Not quite sure what the images.cfm code is doing for you, looks like you are over-complicating things; simply serve the image directly.

1.

<td background="<cfoutput>#imageDirPath#</cfoutput>/test_1.jpg"></td>

2.

<body background="<cfoutput>#imageDirPath#</cfoutput>/test_1.jpg"></body>  (you had an extra "> in there)

3.

<style>
.slide1
{
background-image:url(<cfoutput>#imageDirPath#</cfoutput>/images/test_1.jpg);
width:769;
height:573;

}

</style>

<td class="slide1"></td>