CSS/PHP使用UTF-8时的验证错误


CSS/PHP Validation error when using UTF-8?

我试图验证我的CSS/PHP文件,但得到这个错误:未知错误org.w3c.www.http.HttpInvalidValueException:无效的内容类型。

我使用我的PHP头这样:<?php header("Content-type: text/css; charset: UTF-8");?>
但是CSS验证器抛出一个错误。

所以我把我的代码改为:<?php header("Content-type: text/css; charset: utf-8");?>,它再次显示一个错误:(

但是如果我把代码改成:<?php header("Content-type:text/css;");?> 它通过了验证…

我不知道为什么会发生这种情况(可能是因为我在HTML页面中定义了UTF-8字符集吗?)。

所以谁能告诉我我做错了什么?

我的HTML是这样的:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>My Site Title</title> 
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="stylesheet" type="text/css" media="all" href="http://www.mypage.com/foldername/wp-content/themes/MyTheme/css/style.css">
<link rel="stylesheet" type="text/css" media="all" href="http://www.mypage.com/foldername/wp-content/themes/MyTheme/functions/dynamic_css.php">
</head>
"Content-type: text/css; charset: UTF-8" 

应该定义为:

"Content-type: text/css; charset= UTF-8"