Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 由于mime类型不匹配,CSS被忽略_Html_Css_Mime Types_Mime Message - Fatal编程技术网

Html 由于mime类型不匹配,CSS被忽略

Html 由于mime类型不匹配,CSS被忽略,html,css,mime-types,mime-message,Html,Css,Mime Types,Mime Message,我的网站样式表被我测试过的每个浏览器都忽略了。我在IE9-SEC7113上测试时遇到这个错误:由于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.w

我的网站样式表被我测试过的每个浏览器都忽略了。我在IE9-SEC7113上测试时遇到这个错误:由于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>


您的服务器显然发送了错误的媒体类型信息。但是,这无法从服务器外部进行验证。

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

我的文件名有一个拼写错误,在link和file中拼写为myFile.ccs vs myFile.css。Firefox很好,但IE返回了这个错误。

我意识到,在我的新Windows 10机器上,我无法在本地IIS中启用静态内容。要执行此操作,请从控制面板转到“打开或关闭Windows功能”,然后导航到以下位置:

确保选中此“静态内容”选项。然后,以管理员身份打开命令窗口并执行iisreset


Boom,已修复。

这是否在您自己的个人服务器上?它可能没有发送正确mime类型的CSS文件。您的服务器是什么?您可以更改吗?尝试将绝对路径改为相对路径为什么需要
charset=“UTF-8”
在那里?当收到请求时,它实际上不会影响样式表的MIME类型。