CSS/PHP ファイルを検証しようとしていますが、次のエラーが発生します:不明なエラー org.w3c.www.http.HttpInvalidValueException: コンテンツ タイプが無効です。
PHP ヘッダーを次のように使用しています:<?php header("Content-type: text/css; charset: UTF-8");?>
しかし、CSS Validator はエラーをスローします。
だから私は自分のコードを次のように変更しました:<?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>