You can also use a cold fusion file as a stylesheet as well. Doesn't look too great in the editor , but it works fantastic...
in the stylesheet, just add <cfcontent type="text/css"> in your stylesheet and you can use any cold fusion statement in there. Then, in the head section, just add: <LINK REL=stylesheet HREF="myfile.cfm" TYPE="text/css"> -----Original Message----- From: Chris Wigginton [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 7:27 AM To: CF-Talk Subject: RE: Slightly OT - Forcing Style Sheets Let's try this again... (note to self, the list trims at hyphen lines) Here are three methods you can approach this one. 1) Server Side Dynamic Style Sheets inline Use a cfinlude where the cfm template dynamically generates inline style information. Then all you have to do is include that such as in a standard header. You code the included template to dynamically generate specific styles based on your conditionals. <cfoutput> <STYLE TYPE="text/css"> <!-- H1 { color: #STYLECOLOR#; font-family: #STYLEFONT# } P { background: #STYLEBKGNDCOLOR#; font-family: #STYLEPARAGRAPHFONT# } --> </STYLE> </cfoutput> Note: You can do some real nifty dynamic style sheets using personalization, such as giving a user the capability of setting up their own skin. 2) Server Side Static Styles Use ColdFusion to determine the appropriate stylesheet and create the appropriate html that loads in the style sheet <cfoutput> <LINK REL=stylesheet HREF="#STYLENAME#.css" TYPE="text/css"> </cfoutput> 2) Client Side Static Selected Where you have the various styles defined and then based on the browser being used, JavaScript loads the appropriate style sheet. Put the following in a styles.js file function style(){ // Some tests here... where you check the browser type //and then set the browser var // cook your own conditionals, this shows you how to apply different style sheets if (browser == "ie") { document.write("<link rel='stylesheet' type='text/css' href='styles/ie.css' title='styles'>"); } else if (browser == "nav") { document.write("<link rel='stylesheet' type='text/css' href='styles/nav.css' title='styles'>"); } else if (browser == "ieMac") { document.write("<link rel='stylesheet' type='text/css' href='styles/ieMac.css' title='styles'>"); } else { document.write("<link rel='stylesheet' type='text/css' href='styles/default.css' title='styles'>"); } Put the following in your CFM or HTML page just before the </HEAD> tag <script language="javascript" src="styles.js"></script> <script LANGUAGE="JavaScript"> <!-- style(); //--> </script> </HEAD> -----Original Message----- From: Smith, Daron [PA] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 3:20 PM To: CF-Talk Subject: Slightly OT - Forcing Style Sheets I am working on a project that I am using an inline editor called ewebedit. The basic out of the box functionality of the product is like word, which is fine. When the data is retrieved from the database though, I would like to force the browser to use my style sheet which I specify in the template. Is there a way to get the browser to only read certain styles or do I need to do some stripping of the HTML to force this to happen? I can always modify the style sheet that ewebedit uses but I was hoping to avoid that. Thanks for your help, Daron J. Smith Web Developer PSEA [EMAIL PROTECTED] 717-255-7141 1-800-944-PSEA (7732) x 7141 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists