CSS not working in ColdFusion 8

Copy link to clipboard
Copied
We just upgraded from ColdFusion MX7 to ColdFusion 8 and all of our CSS that worked in MX7 suddenly do not work in 8. Does anyone have any ideas as to what might be happening?
Thanks!
Copy link to clipboard
Copied
Right, well I think we'll need more into than that, as CSS has absolutely nothing to do with CF by default.
Look at the source code of the generated page, does it look right?

Copy link to clipboard
Copied
Yep - the browsers view source shows all the CSS code as it should. Here is what we're doing:
CSS call in the head:
<head>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
CSS reference in the code:
<table width="95%" border="0" cellpadding="2" bordercolor="navy" align="center" class="table_content">
CSS code in styles.css:
@media screen {
body {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.field_label {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #990000;}
.header:link {font-family: Verdana,Arial,Helvetica,sans-serif; color: #FFFFFF; text-decoration:none}
.header:visited {font-family: Verdana,Arial,Helvetica,sans-serif; color: #FFFFFF; text-decoration:none}
.header:hover {font-family: Verdana,Arial,Helvetica,sans-serif; color: #0000FF; text-decoration:none}
.header:active {}
.headerblack:link {font-size: 12px; font-family: ArialNarrow,Helvetica,sans-serif; color: #000000; text-decoration:none}
.headerblack:visited {font-size: 12px; font-family: ArialNarrow,Helvetica,sans-serif; color: #000000; text-decoration:none}
.headerblack:hover {font-size: 12px; font-family: ArialNarrow,Helvetica,sans-serif; color: #0000FF; text-decoration:none}
.headerblack:active {}
li {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.navigation {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
text-align: center;}
p {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.style2 {font-family: Arial, Helvetica, sans-serif;
font-size: xx-small;
color: black;}
.table_content {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.textbox {font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: black;}
}
@media print {
body {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
li {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.navigation {display: none;}
.noprint {display: none;}
p {font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: black;}
.style2 {font-family: Arial, Helvetica, sans-serif;
font-size: xx-small;
color: black;}
.table_content {font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: black;}
.textbox {font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: black;}
}
It all seems pretty basic to me and it worked fine in MX7?
Copy link to clipboard
Copied
CSS call in the head:
<head>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
Right. But does that request actually find the CSS? It's all well and good that you're requesting it... that doesn't mean it's being returned.
--
Adam
Copy link to clipboard
Copied
Formerly Awesome Owain pre-empted me: this has nothing to do with the CF upgrade.
Did your web server also get changed? Have you messed with your virtual directories, so the browser is requesting CSS that the web server can no longer find / serve?
--
Adam

Copy link to clipboard
Copied
Yes we did rebuild our server first to upgrade the OS to Windows Server 2008. Do we have to do something with the virtual directory permissions?
Copy link to clipboard
Copied
Yes we did rebuild our server first to upgrade the OS to Windows Server 2008. Do we have to do something with the virtual directory permissions?
Well it needs to be configured to serve the things requested properly. That's not necessarily going to be permissions-based. It's not really a question for these forums either: it's more for an IIS forum (I'm not being dismissive - despite how it might sound - it's just if you have IIS config questions, asking on an IIS forum makes more sense than asking on a CF forum. You'll get more informed answers).
If you browse to the URL of the CSS file, what do you get? Bear in mind you're calling it in with a relative URL in that code above, so the URL the browser will be trying will be the same directory as the code. EG: if you were browsing to http://yourdomain.com/path/to/myFile.cfm, then the CSS file needs to be http://yourdomain.com/path/to/style.css
--
Adam

Copy link to clipboard
Copied
I was wondering if it might be an IIS issue. I'll work with the guy who rebuilt the server and if we can't figure it out I'll check out the IIS forum.
Thanks for the help.
Copy link to clipboard
Copied
Just check whether IIS is returning the CSS file first (as per my second para). That'll give you a place to start.
--
Adam

Copy link to clipboard
Copied
We figured it out. We needed to add the folder that contains all our ColdFusion applications as a virtual folder in IIS.
Thanks again for your help.
Copy link to clipboard
Copied
Cool. No worries.
--
Adam

