Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CSS not working in ColdFusion 8

Guest
Nov 08, 2011 Nov 08, 2011

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!

2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 08, 2011 Nov 08, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2011 Nov 08, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2011 Nov 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2011 Nov 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2011 Nov 08, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2011 Nov 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2011 Nov 08, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2011 Nov 08, 2011

Just check whether IIS is returning the CSS file first (as per my second para).  That'll give you a place to start.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2011 Nov 08, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2011 Nov 08, 2011
LATEST

Cool.  No worries.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources