Gzip compressed css file with php header, first css line does not work
774
I am using gzip to compress my files so I need to add the following code to the top.
ob_start("ob_gzhandler");
header("content-type: text/css; charset: UTF-8");
header("cache-control: must-revalidate");
header("expires: ".gmdate('D, d M Y H:i:s', time() + 1000)." GMT");
The problem is now that the first line of css code in my file does not work. e.g.
body{
color: red;
font-weight: bold;
}
using this the text would be bold but not red.
Looking forward to an advice.
Thanks in advance.
Answer
Solution:
Edit:
From the comments, it turned out to be because:
Probably either:
The
font-color
property does not exist.Use
instead.
If the text is indeed bold, then your CSS file is working, so there shouldn't be any more problems.
Although I think the last line of your PHP should be: