Download external css file but not applicable

Wetware Error

It was a typo - there were 2 different css files with similar names, and I linked to one on one site and the other to another

Apologize from muppet :(

Closed

I have the following line in the html head chapter:

<link rel="stylesheet" href="http://files.hypernumbers.com/redesign/frontpage.css"> 

When I browse this page from the hypernumbers.com domain, it loads fine and then applies.

But when I look at the same page from the hypernumbers.dev domain, it loads (the Firebug and Chrome tools show me that there is a CSS file), but it does not apply to the page

Is there any subject of priority / subdomain of a domain that doesn't know what I don't know about?

Update

I tried it in Opera, where it does not load either in hypernumbers.com or in hypernumbers.dev ...

+4
source share
2 answers

This is a pretty old question, but since this is the best result on Google, I will put my solution here.

I had the same problem, my CSS files were accessible and loaded by the browser, but in fact they were not used. I could just browse CSS manually, but both Firefox and Chrome did not apply them.

This was my link tag:

 <link href="/static/css/bootstrap.css" rel="stylesheet" type="text/css"> 

It looks good that the right way ... I even remembered to set the type, but not the cube.

As it turns out, my web server forced the content type in application/octet-stream CSS files. Therefore, even if I specified type in the link tag, Firefox and Chrome see the wrong type of content from the server and refuse to use stylesheets.

If you use Firefox with Firebug , you can see the type of content that your server sends on the Network tab.

In my case, using Lighttpd, the fix was to add ".css" => "text/css" to mimetypes.assign like this:

 mimetype.assign = ( ".html" => "text/html", ".txt" => "text/plain", ".jpg" => "image/jpeg", ".png" => "image/png", ".css" => "text/css", "" => "application/octet-stream" ) 

Hope this saves someone from a couple of googling watches and heads scratching.

+13
source

It may be a little crazy guess, but if you add type="text/css" to the attribute, does it matter? Also, what is the encoding in the CSS file and html document?

As a final check, did you consider downloading the file and creating a local copy? Just to make sure there is nothing between your network and that Hypernumbers is causing problems?

+1
source

All Articles