Skip navigation
HSC_Canada
Currently Being Moderated

cfsavecontent loses css

Jun 1, 2006 8:52 AM

I specify an external stylesheet using <LINK> in <HEAD> section. If I display the output interactively to the browser, the output looks well with my intented style. However, if I save the output using <CFSAVECONTENT> and write to disk, viewing this html file on browser loses all the style.

Is there a way to specify css for <CFSAVECONTENT>?

Thanks
Betty
 
Replies
  • Currently Being Moderated
    Jun 1, 2006 9:05 AM   in reply to HSC_Canada
    cfsavecontent doesn't strip out anything, or "lose" anything. Therefore, the problem is in your <link>.

    Is it an absolute or relative URL? If relative, you need to make it relative to the page that will be displaying the saved content, not relative to the page that's creating the saved content.

    View the page that displays the saved content with the "lost" css. View source on the page. Copy the link from your <link> tag and try to go directly to that css page.
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 7, 2012 8:59 AM   in reply to HSC_Canada

    I recently solved a similar problem. I am using cfsavecontent to send an html table with grouping. whenever I tried to use css I "lost" all of my styling. in order to get it to work, I created a <head> tag and used <cfinclude template="email.css">

    <cfmail

          to="#RecipientAddress#"

          from="#SenderAddress#"

          subject="#EmailSubject#"

          type="HTML">

    <HTML>

        <head>

            <style type="text/css">

            <cfinclude template="/email.css">

            </style>

        </head>

        <body>

        <cfoutput>

        #cfsavecontentvariable#

        </cfoutput>

        </body>

        </HTML>

        </cfmail>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 7, 2012 9:29 AM   in reply to Michael-LSG

    I typically use cfsavecontent with cfhtmlhead. 

     

    <cfsavecontent variable="css">

     

    <--- CSS Goes here --->

     

    </cfsavecontent>

     

    <cfhtmlhead text="#css#" />

     

    jason

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points