2012-07-10 186 views
2

我的网站样式表正在被我测试过的每个浏览器忽略。在IE9上测试时出现这个错误 - SEC7113:由于MIME类型不匹配,CSS被忽略由于MIME类型不匹配,CSS被忽略

这里是引用它的头的html。让我知道你是否需要更多。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
    <head runat="server"> 
    <title></title> 

    <!--The style sheet below is the one being ignored--> 
    <link rel="stylesheet" type="text/css" charset="UTF-8" href="Styles/Site.css" /> 

    <!-- Skin CSS file --> 
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/skin.css" /> 
    <!-- Utility Dependencies --> 
    <script src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
    <script src="http://yui.yahooapis.com/2.9.0/build/element/element-min.js"></script> 
    <!-- Needed for Menus, Buttons and Overlays used in the Toolbar --> 
    <script src="http://yui.yahooapis.com/2.9.0/build/container/container_core-min.js">  </script> 
    <script src="http://yui.yahooapis.com/2.9.0/build/menu/menu-min.js"></script> 
    <script src="http://yui.yahooapis.com/2.9.0/build/button/button-min.js"></script> 
    <!-- Source file for Rich Text Editor--> 
    <script src="http://yui.yahooapis.com/2.9.0/build/editor/editor-min.js"></script> 
    <script src="http://yui.yahooapis.com/2.9.0/build/editor/simpleeditor-min.js"></script> 


</head> 
+0

这是你的个人服务?它可能不是用正确的MIME类型发送CSS文件。 – TheZ 2012-07-10 19:46:48

+0

你的服务器是什么?你能改变[.htaccess文件](http://wiki.joyent.com/display/gen/Configuring+MIME+Types+in+.htaccess)吗? – 2012-07-10 19:46:48

+1

尝试将绝对路径改为相对 – debianek 2012-07-10 19:47:18

回答

7

我明白了,我刚刚开始工作的公司未能在设置我的计算机时为IIS安装静态内容功能。所以它忽略了我所有的样式表,图像和链接。

0

您的服务器显然发送错误的媒体类型信息。虽然这不能从服务器外部验证。

0

我在文件名中输入了一个拼写错误,并且在链接和文件中拼写了myFile.ccs和myFile.css。 Firefox很好,但是IE返回了这个错误。