Reply to topic
Please Help! Style sheets and Coldfusion
drandalray


Joined: 27 Apr 2004
Posts: 3
Reply with quote
Hello,

I've been beating my head against a wall and it hurts. Please help me.

How do you include (ie. LINK) style sheets in ColdFusion (using Dreamweaver MX)

I've seen some mention that you should use CFINCLUDE but when I try that, I only see a rendered page with the CSS coding displayed as the text of the page. I've tried this approach using both STYLE.CSS and STYLE.CFM.

Here is my current 'configuration':

- Application.cfm
- Index.cfm (includes Navigation.cfm via CFINCLUDE)
- Navigation.cfm (included in Index.cfm)

The file I am attempting to apply styles to is Navigation.cfm.

To complicate things even more, the style sheets work great when I embed them in Navigation.cfm. But when I export the embedded styles to create an external style sheet and then LINK the external style sheet in Navigation.cfm, the styles no longer have any affect on the page.

I'm very frustrated and confused. Please help me.

Thanks.
webweaver6


Joined: 30 Jan 2004
Posts: 101
Location: Grayslake, IL
Reply with quote
When using the cfinclude, I have found that the included file should not have any header or body info, just the html and cfm of what you are trying to include. Otherwise, if you view the source, you'll see the html, head, body tags, then the html, head, body tags again, then the closing of all of those. I think if you include the link to your css file in the index.cfm and the other main files in the site you'll have the styles applied.
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
This is what the html look like to link to a style sheet, just put this somewhere in the header of your html for the page you are trying to apply the style to.

<link rel="stylesheet" type="text/css" media="screen" href="/css/lite.css" />

Make sure you have the pathway correct to your .css file. In this instance I'm using a absolute path, so the pathway to the .css file would be this:

http://mydomain.com/css/lite.css

Otherwise the file will not be found and no style applied to the page.
Please Help! Style sheets and Coldfusion
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic