Firefox不显示我的CSS [英] Firefox doesn't show my CSS

查看:117
本文介绍了Firefox不显示我的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,Firefox 3.6.3 不显示我正在做的页面的CSS,但是 Internet Explorer 8 没有。

>

我曾经在家中和朋友家中尝试过,而且都发生在两个人身上。但是,如果我去Firefox Web Developer工具栏(我已经安装了它)并选择CSS =>编辑CSS,那么样式会出现在页面和编辑器中!一旦我关闭它,它们就会再次消失。我不知道是什么问题:(



 < DOCTYPE HTML PUBLIC -  // W3C // DTD XHTML 1.0! Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns =http://www.w3.org/1999/xhtml XML:LANG = en 的> 
将头部>
将标题>学生< /标题>
将META HTTP-当量= 内容类型 CONTENT =文本/ HTML;字符集= UTF-8\" />
将链接的rel = 样式表 类型= 文本/ CSS的 href = style.css文件/>
将/头>

我用W3C CSS验证器验证了我的两个css文件, > b

您有什么想法可以解决问题吗?

在此先感谢。


解决方案

我敢打赌,CSS文件没有发出内容类型啤酒:文/ CSS header。这导致样式表不能在Firefox中工作。IE会忽略内容类型。

如果这是原因,你应该在Firefox错误控制台中得到一个警告。您可以使用Firebug的 net 标签来验证发送的内容类型。



至于内容类型为什么不是'发送,这将是一个服务器问题,我认为。当CSS文件是 .php .asp 文件时,通常会发生这种情况,在交付时由服务器自动键入。


I have a strange problem, Firefox 3.6.3 doesn't show the CSS of the page I'm doing, but Internet Explorer 8 does.

I have tried at home and at one of my friend's home, and it happens in both. But, if I go to the Firefox Web Developer toolbar (i have it installed) and select CSS=>Edit CSS, then the styles appears appears in the page and in the editor! As soon I close it, they disappears again. I have no idea what the problem is :(

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Students</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

I've validated my two css files with the W3C CSS validator and there are no problems.

Do you have any idea about what could be the problem?

thanks in advance.

解决方案

I'll bet a beer that the CSS file is not sending the content-type: text/css header. This causes style sheets to not work in Firefox. IE will ignore the content type.

If this is the reason, you should get a warning in the Firefox error console. You can use Firebug's net tab to verify the content-type sent.

As to why the content type isn't sent, this would be a server issue I think. It usually happens when the CSS file is a .php or .asp file that doesn't get assigned the correct content type automatically by the server when delivering.

这篇关于Firefox不显示我的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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