IE10本地页面无法打开CSS [英] IE10 local page won't open CSS

查看:93
本文介绍了IE10本地页面无法打开CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开本地页面(如C:\ Documents \ index.html)时,仅安装了IE10,即使使用了默认重置",它也拒绝加载简单的链接样式表,而直接调用如下: /p>

Just installed IE10, and even with a "default reset," when I open a local page (like C:\Documents\index.html), it refuses to load a simple linked stylesheet, with a straightforward call like:

<link href='common.css' type='text/css' rel='stylesheet'>

控制台错误消息是: SEC7113:由于mime类型不匹配,CSS被忽略了

我已经浏览了安全设置,但似乎没有任何改变.

I've hunted through the security settings, but nothing seems to change the behavior.

从网络上查看页面,当然没有问题.

Viewing the page from the web, there's no problem, of course.

有人知道吗?

(FWIW,我在Win7/64台式机和老化的小型Win7/32上网本上看到完全相同的问题.)

(FWIW, I'm seeing exactly the same problem on a Win7/64 desktop machine and on an aging little Win7/32 netbook.)

这是一个简单的测试用例.将此HTML另存为index.html在PC上的文件夹中:

Here's a simple test case. Save this HTML as index.html in a folder on your PC:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic</title>
<link href="common.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>This text should be red.</p>
</body>
</html>

现在将此CSS与common.css保存在同一文件夹中:

Now save this CSS in the same folder, as common.css:

body {
    color: red;
}

使用Firefox或Chrome打开index.html-红色文本,对吗?但是,如果我使用IE10打开它,则文本为黑色-不会加载common.css文件.

Open index.html with Firefox or Chrome - red text, right? But if I open it with IE10, the text is black - the common.css file is not being loaded.

推荐答案

我找到了!

可以使用控制面板"默认程序/关联文件类型..."来设置要由Notetab Light(我最喜欢的通用文本编辑器)打开的.css文件.但是,如果您进入Notetab Light本身并选择视图",选项",关联",然后将css添加到列表中,则会产生我一直看到的错误.

It's OK to use the Control Panel "Default Programs / Associate a file type..." to set .css files to be opened by Notetab Light (my favorite general-purpose text editor). However, if you go into Notetab Light itself and choose View, Options, Associations, and add css to the list, this generates the error I've been seeing.

显然,这正在生成一个注册表项,当从HTML页面调用IE10时,该注册表项将导致IE10无法打开本地CSS文件. IE9不受此困扰(我以前从未遇到过问题,并且我已经使用Notetab Light已有很长时间了.)

Apparently, this is producing a registry entry that causes IE10 to be unable to open a local CSS file when it's called from an HTML page. IE9 wasn't afflicted by this (I never had a problem before, and I've been using Notetab Light for ages).

这篇关于IE10本地页面无法打开CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆