Applying style when using the cfwindow tag (not JavaScript)

  • Post author:
  • Post category:Uncategorized

Since I struggled with this one, and I had to do a lot of googling to figure it out, I thought I’d share to help others that might run into the same problem. ColdFusion’s cfwindow tag allows you to apply styles to the window header and body, but the way to do this was not immediately obvious to me. The docs say that you can use a “CSS style specification” in the bodyStyle attribute. So my assumption was that you’d insert a class or id from your css stylesheet. I tried both and neither worked. Most of the articles I found from Googling dealt with applying style when you dynamically create CFWindows using JavaScript. But in my case I am just using the CFWindow tag.I discovered that you are supposed to actually just hard code CSS in those style attributes. You can’t reference a predefined CSS class or id. At least, it wouldn’t work for me, if you know differently let me know in the comments.So, this does NOT work:But this DOES work: