Solved

ASP linked stylesheet mime type problem in firefox

Posted on 2009-04-10
3
585 Views
Last Modified: 2012-06-27
I have an asp page that ignores the stylesheet in firefox. I have researched it and understand the problem, just not how to fix it. The error that I get in the error console is: the stylesheet XXXX was not loaded because it's mime type "application/octet-stream" is not "text/css".

Here is my link line:

<link rel="stylesheet" type="text/css" href="stylesheets/style.css">
I have tried different link references, /stylesheets/style.css, ./stylesheets/style.css including full url. I have also tried adding <% response.contenttype="text/css" %> before the line, but that did not help either as the page nows opens up in viewsource mode. The server is sending the linked stylesheet with the same mime type as the page and firefox, correctly, does not assume the correct mime type.
0
Comment
Question by:troyd1
  • 2
3 Comments
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 24120688
The simplest solution would be to change the mime-type the server associates with the ".css" extension.

Another would be to rename the stylesheet to "style.asp" and then set response.contenttype at the top of the file.
0
 

Author Comment

by:troyd1
ID: 24169840
The first does not work for asp pages. It treats them all as asp. FF requires the content type to be text/css.
0
 
LVL 42

Expert Comment

by:David S.
ID: 24170741
> FF requires the content type to be text/css.

Yes, I know.  Perhaps you don't understand what I meant.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question