1

This question is probably not the best SO practice but I really don't have a clue of what is going on in here.

One of my .css files sometimes (~50% of the times) is loaded as an image. Here the screenshot:

enter image description here

which is supposed to be text/css (as it's loaded the other ~50% of the times).

The other interesting part is that this happens only in the pages loading also the two following files:

<script type="text/javascript" src="../js/tabcontent.js" ></script>
<link type="text/css" rel="stylesheet" href="../css/tab-content/template5/tabcontent.css"/>

as described in here. I tried removing the javaScript only and my css loads just fine. Have you ever had this issue?

nigmastar
  • 470
  • 5
  • 15
  • 1
    Is there a chance the js has an error? Or malformed function? If you place the js call AFTER the css load, does it ever error then? Additionally put a second load call after the js to show/prove that the js is the issue. – KnowHowSolutions Oct 15 '13 at 16:55
  • is the CSS not working when it is loaded this way? – Dani Oct 15 '13 at 16:56
  • I know that styles should actually be loaded first, try _all_ the stylesheets above the scripts, does it make a difference? – epoch Oct 15 '13 at 16:57
  • Also is that referenced path the correct one? If not, it's a clue to where the issue is in the js. – KnowHowSolutions Oct 15 '13 at 16:59
  • 1
    @KnowHowSolutions Hi thanks for your comment. Paths are fine, there are other pages (in the same folder) loading the same .css using that path. I place the js call **after** as you said and it worked. Thanks! – nigmastar Oct 15 '13 at 17:16
  • 1
    @epoch Thanks for that I did and I works very well now. – nigmastar Oct 15 '13 at 17:16

1 Answers1

1

image/png is the MIME type. I'm not sure how Javascript would overrite this, but you could try adding the following code to your .htaccess file

AddType text/css .css

this tells your server to send the content type in the header.

Dani
  • 1,220
  • 7
  • 22