Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5948975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:11:04+00:00 2026-05-22T17:11:04+00:00

I am using gzip to compress my files so I need to add the

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:11:05+00:00Added an answer on May 22, 2026 at 5:11 pm

    Edit:

    From the comments, it turned out to be because:

    the php code was inserting something
    into the css file.

    Probably either:

    • an unprintable character similar to this: CSS: Is there any difference between these two parts?
    • or a UTF-8 BOM.

    The font-color property does not exist.

    Use color: red 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:

    header("expires: ".gmdate('D, d M Y H:i:s', time() + 1000)." GMT"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm compressing a string with Gzip using this code: public static String Compress(String decompressed)
I need to pre-compress some very large html/xml/json files (large data dumps) using either
I am using the Django GZip middleware (django.middleware.gzip.GZipMiddleware) to compress content if the browser
I'm using the following code to compress a small (~4kB) HTML file in C#.
When using Gzip to compress css and js files, does the compressed css or
I'm developing a website, I'm using gzip.exe to pre-compress css and js files (it's
I need to compress a file using GZip by batch of specified size (not
so I pasted following into my .htaccess (www.storyfollower.com): #Gzip # compress the files AddOutputFilterByType
I am trying to encode a list as JSON, compress it using gzip in
I need an example for compressing a string using GZip in android. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.