IE9 Not applying linked style sheets

陌路散爱 提交于 2019-12-30 07:20:48

问题


I have a wierd problem. I developed a site that works fine in most browsers. I just upgraded to IE9 and none of my styles are being applied. I'm viewing this on my local pc as this site is not on the internet just yet. All in-line or page level styles get applied correctly but the styles linked from external css files in the HEAD section aren't applied at all. If I use the developer toolbar and view the site as IE8, IE7, or any other mode the sites work fine. There's about 6 style sheets and no extra components so it shouldn't be an issue of too many style sheets. I can't figure what is causing this. Anybody else seen this?


回答1:


Maybe your server do not send the right mime-type http://msdn.microsoft.com/en-us/library/gg622939%28VS.85%29.aspx




回答2:


Codler's link, combined with the fact that "I'm viewing this on my local pc as this site is not on the internet just yet," almost certainly gives the answer. When serving files from your local machine, it is usually pretty unlikely that the correct MIME type gets sent.

Generally, to test a website, you need some kind of web server---even if it's just one you set up on your own machine. The file system is really not meant for serving web pages, and behaves in unpredictable ways (e.g. Firefox can't do web fonts on the file system, IIRC).



来源:https://stackoverflow.com/questions/5363127/ie9-not-applying-linked-style-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!