Internet Explorer 根本不显示 CSS

发布于 2024-11-08 07:03:19 字数 1245 浏览 0 评论 0原文

我已经检查了整个文件,包括验证和嗅出丢失或不合适的字符。

我还删除了 CSS 文件中除几行之外的所有内容,并尝试了此操作。

Internet Explorer 根本不显示 CSS,而 FF、Chrome 和 Safari 都没有问题。

有人知道 IE 中可能已更改的设置或我丢失/使用的可能架构可能会导致此问题吗?

<!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">

            <head profile="http://www.w3.org/2005/10/profile">
            <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
            <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
            <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
            <meta http-equiv="content-LANGUAGE" content="EN"/>
            <meta name="ROBOTS" content="ALL"/>
            <meta name="revisit-after" content="14 days"/>
            <meta name="resource-type" content="document"/>
            <meta name="distribution" content="Global"/>
            <meta name="rating" content="General"/>
            <link rel="stylesheet" type="text/css" href="http://www.****************.css" />
            <script .......
            </head>

I have gone over the entire file including validating and sniffing out missing or out-of-place characters.

I have also removed all but a couple lines of the CSS file and tried this as well.

Internet Explorer is simply not showing CSS while FF, Chrome, and Safari all have no issues.

Anybody know of a setting in IE that may have been changed or a possible schema I am missing/using that could cause this?

<!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">

            <head profile="http://www.w3.org/2005/10/profile">
            <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
            <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
            <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
            <meta http-equiv="content-LANGUAGE" content="EN"/>
            <meta name="ROBOTS" content="ALL"/>
            <meta name="revisit-after" content="14 days"/>
            <meta name="resource-type" content="document"/>
            <meta name="distribution" content="Global"/>
            <meta name="rating" content="General"/>
            <link rel="stylesheet" type="text/css" href="http://www.****************.css" />
            <script .......
            </head>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

停滞 2024-11-15 07:03:19

您的页面上有 2 个 元素:

<head>
<head profile="http://www.w3.org/2005/10/profile">

You have 2 <head> elements on your page:

<head>
<head profile="http://www.w3.org/2005/10/profile">
小镇女孩 2024-11-15 07:03:19

也许是因为您的 标记中有一个额外的 标记,这让 IE 感到困惑?

<head>
<!-- snip other stuff ... -->
<head profile="http://www.w3.org/2005/10/profile">

<link rel="stylesheet" type="text/css" href="http://www.**************.css" />

如果删除它不起作用,那么我建议尝试生成一个最小的示例来演示您的问题。首先删除所有内容,但显示未应用样式的示例除外。然后删除越来越多的标头和代码,直到找到一个小示例,其中问题仍然存在,但它除了展示问题的最低限度之外没有任何其他内容。这样做的过程可能会帮助你找到自己的问题;但如果没有,那么您可以通过编辑您的问题在此处发布完整的示例,我们可以根据演示问题的实际代码提供更好的建议,而不是不包含足够信息来确定问题所在的不完整摘录。请记住发布示例的 HTML 和 CSS。

Maybe it's the fact that you have an extra <head> tag within your <head> tag that's confusing IE?

<head>
<!-- snip other stuff ... -->
<head profile="http://www.w3.org/2005/10/profile">

<link rel="stylesheet" type="text/css" href="http://www.**************.css" />

If removing that doesn't work, then I would recommend trying to produce a minimal example that demonstrates your problem. Start by removing all of the content, except for an example to show that the style isn't being applied. Then remove more and more of your headers and code, until you find a small example in which the problem is still present, but it has nothing other than the bare minimum to demonstrate the problem. The process of doing that might help you to find your own problem; but if not, then you can post a complete example here, by editing your question, and we can give better advice based on actual code that demonstrates the problem, as opposed to an incomplete excerpt that doesn't contain enough information to determine what's wrong. Remember to post both the HTML and CSS for your example.

别挽留 2024-11-15 07:03:19

您有重复的 声明。此声明应该只出现一次,并且应该是 中的第一个内容。

You have duplicate <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> declarations. This declaration should only appear once and should be the first thing in your <head>.

情话难免假 2024-11-15 07:03:19

检查用于包含 css 文件的链接标记中的 rel 属性和 type 属性。

例如:

<link rel="stylesheet" href="styles.css" type="text/css" />

Check for rel attribute and type attributes in the link tag used to include the css file.

For example:

<link rel="stylesheet" href="styles.css" type="text/css" />
尴尬癌患者 2024-11-15 07:03:19

声明 Doctype

<!DOCTYPE html>

Declare a Doctype

<!DOCTYPE html>
手心的温暖 2024-11-15 07:03:19

head 标签内有一个 head 标签,位于链接标签之前。删除它,看看是否有帮助。

You have a head tag inside your head tag, right before the link tag. Remove that and see if it helps.

陌路黄昏 2024-11-15 07:03:19

显然,CSS规则仅适用于列为 text/html

http://www.w3.org/MarkUp/2004/xhtml-faq#css

这可能是问题所在吗?

Apparently, css rules only apply to documents listed as text/html

http://www.w3.org/MarkUp/2004/xhtml-faq#css

Could this be the issue?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文