> I'm trying to think of a way to change values in a css file using CF.  How
can I write
> to a css file?  Any thoughts?

You can serve a .cfm as CSS, just add the proper mime-type:

<cfcontent type="text/css; charset=ISO-8859-1">
body{
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: <cfoutput>#url.size#</cfoutput>px;
}

Be aware that browsers try to cache the css files and this may conflict with
what you are trying to do.
Of course, you may set the HTTP headers for the CSS file to avoid letting
the browser cache it, but that may be not so good as well...

Finally, you may split the CSS into two files:

1) A static CSS file, with the bulk of the rules; the browser is welcome to
cache it

2) A .cfm file served as CSS, containg only the "dynamic" rules. Here you
may prevent the browser to cache the file

Hope it will help

----------------------------
Massimo Foti
DW tools: http://www.massimocorner.com
CF tools:  http://www.olimpo.ch/tmt/
----------------------------




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182044
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to