CSS styles are completely missing when retrieved from server, why?
Have to say I really don't understand开发者_如何学Python how come this could happen:
I've done some code in html, css and a little bit of javascript, nothing fancy, and just uploaded to two host servers, one to my commercial hosting, the other to uni server.
The funny thing is my commercial server renders exactly as what I can see on localhost, which is of course the expected result. However, the page rendering on uni server is a nightmare:
The CSS stylesheets, although are retrieved from server (verified using Firefox and checked http responses), do nothing to page elements as if there were not there...which I don't understand why?
There is nothing different in my code I believe, I've used two different FTP tools to transfer the code. The only different that I can tell are the server environments, particularly one is Apache 2.0+ and the uni Apache 1.3.3
But I reckon client-side code would not really depend on Apache server versions, would it?
Thanks for any suggestion in advance!
The server where it doesn't work is sending the CSS file back with the wrong MIME-type (text/plain
instead of text/css
). Recent browsers are liable to ignore CSS files that don't carry the correct MIME-type. So yes, it is an issue of server configuration (mod_mime
for Apache).
精彩评论