Include dynamic style sheet

I would like to link to a dynamic style sheet created in CF (<link href="CSS.cfm" rel="stylesheet" type="text/css">) (it is being linked on a CF page). I've added <cfcontent type="text/css; charset=ISO-8859-1"> to the css.cfm and the page displays correctly in in IE and Mozilla, but the stylesheet isn't applied in Netscape or Opera?

  <cfcontent type="text/css; charset=ISO-8859-1">
 <cfquery name="userSettings" datasource="barney">
     SELECT * FROM userSettings WHERE user=#authenicatedUserID#
<style type="text/css">
     .NormalText {  font-family: <cfoutput>#userSettings.normalFont#</cfoutput>;}

I can make it work in all browsers, by using a cfinclude, but I would prefer to link to the dynamically generated CSS.

How can I get this to work w/ Netscape & Opera (while still working in IE & Mozilla) using the link implementation?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This is probably just one of a hundred different ways of doing this.  Off the top of my head right now I think you could generate .css page everytime a user logs in, and populate it with info from your userSettings table.  You could name them #Client.CFID#_#Client.CFToken#.css, and then use this to link them in:

<link href="PATH_TO_CSSFILES/#Client.CFID#_#Client.CFToken#.css" rel="stylesheet" type="text/css" />

Client.CFID and Client.CFToken are used with session variables.

LERNWebmasterAuthor Commented:
Thank you for the suggestion, I would rather not write CSS files for each user each time, as over time I'm going to have a lot of CSS files to clean out and the constant disk writes would affect performance.  Any others?  I was thinking that I'm just not setting the content type correctly.
Check out Eric Meye on CSS
Maybe that'll get you directed in the right path. But I believe this question is best suited for the CSS ppl.

good luck


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

<cfquery name="userSettings" datasource="barney">
     SELECT * FROM userSettings WHERE user=#authenicatedUserID#

should that be
<cfquery name="userSettings" datasource="barney">
     SELECT * FROM userSettings WHERE user='#authenicatedUserID#'

LERNWebmasterAuthor Commented:
using the single quotes isn't necessary, as the data type for user is int.
thank you for accepting my answer LERNWebmaster  .. however, if my answer was the accepted answer.. why the low C grade?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.