Skip to main content
July 19, 2008
Answered

CFML in CSS

  • July 19, 2008
  • 1 reply
  • 244 views
I am trying to add a rotating image CF tag in a CSS element... sort of something like the following:

<style type="text/css">
div#container {
background-color : #fff;
background-image : url(<cf_coop_banner>);
background-attachment:scroll;
background-repeat : repeat-y; }
</style>
<div id="container">
</div>
---------------------------------------------------------------------------

After i run the cfm file and view the source I get the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>WorrySome.com</title>
<!-- Andy Clarke ( http://www.stuffandnonsense.co.uk)
Molly E. Holzschlag ( http://www.molly.com) -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
div#container {
background-color : #fff;
background-image : url(
------------------------------------------------------------------------------------------

The tag is blowing up the CSS, I know the tag works OK in my other pages, this is the first time I am trying to work with it in CSS.

I guess the question is can I us CFML in this manner?

Any ideas?
    This topic has been closed for replies.
    Correct answer
    Looks like I found out the answer is yes, you can CFML in a CSS element.

    My problem is the CFTag that I am using.

    1 reply

    Correct answer
    July 19, 2008
    Looks like I found out the answer is yes, you can CFML in a CSS element.

    My problem is the CFTag that I am using.