Skip to main content
November 8, 2011
Question

CSS not working in ColdFusion 8

  • November 8, 2011
  • 2 replies
  • 2796 views

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!

This topic has been closed for replies.

2 replies

Inspiring
November 8, 2011

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

November 8, 2011

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?

Inspiring
November 8, 2011

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

Owainnorth
Inspiring
November 8, 2011

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?

November 8, 2011

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?

Inspiring
November 8, 2011

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