12

Wetware Error

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

Apologies from a muppet :(

Closed

I have the following line in an html head section:

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

When I view this page from the domain hypernumbers.com it loads fine and then is applied.

But when I view the same page from the domain hypernumbers.dev it loads (Firebug and Chrome tools show me that the CSS file is there) but it isn't applied to the page

Is there some sort of domain precedence/sub-domain thing going no that I don't know about?

Update

Tried it in Opera where it doesn't load in either hypernumbers.com or hypernumbers.dev...

4
  • Is the behavior consistent across all major browsers? Commented Oct 3, 2010 at 15:35
  • Chrome and Firefox (my dev box is on Linux so that's your lot) Commented Oct 3, 2010 at 15:35
  • well, that's not entirely true, there's Opera too. Commented Oct 3, 2010 at 16:07
  • I had the same problem but instead of linking like this <link rel="stylesheet" href="files.hypernumbers.com/redesign/frontpage.css"> I tried this way <link rel="stylesheet" href="//files.hypernumbers.com/redesign/frontpage.css"> This works fine for me and solved my problem Commented Dec 15, 2017 at 6:57

2 Answers 2

37

This is a pretty old question, but since it's the top result in Google I'll put my solution here.

I was having the same issue, my CSS files were accessible and were being downloaded by the browser, but they weren't actually being applied. I could browse to the CSS manually just fine, but both Firefox and Chrome weren't applying them.

This was my link tag:

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

Looks fine, that's the correct path... I even remembered to set the type, but no dice.

As is turns out, my web server was forcing the content-type on CSS files to application/octet-stream. So even though I specified type in the link tag, both Firefox and Chrome were seeing the wrong content-type from the server and refusing to apply the stylesheets.

If you're using Firefox with Firebug installed you can see the content-type your server is sending on the "Net" tab.

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

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 hours of Googling and head scratching.

Sign up to request clarification or add additional context in comments.

1 Comment

And if you're using nginx, make sure to add include mime.types; in the http{} section of your config
1

It might be a bit of a crazy guess, but if you add in the attribute type="text/css" does that make any difference? Also, what's the encoding on the CSS file and the html document?

As a last check, have you considered downloading the file and making a local copy? Just to ensure that there's nothing between your network and Hypernumbers causing issues?

2 Comments

Good suggestion, I tried that and it doesn't make any difference :(
well I did discover that Opera will give you lovely error messages for all your CSS typos so I did manage to fix up half a dozen little niggly things that might have become bugs which is schweet :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.