Fredefl
Fredefl

Reputation: 1381

When CSS is gzipped it doesn't work

I my css stylesheet that i want to gzip. I have it linked as a external stylesheet.
Here: http://illution.dk
And this is the stylesheet: http://illution.dk/include/style.css
And it IS gzipped: http://www.whatsmyip.org/http_compression/?url=aHR0cDovL2lsbHV0aW9uLmRrL2luY2x1ZGUvc3R5bGUuY3Nz

My problem is that it doesn't seem to work. Am i doing something wrong?

UPDATE: I found out that i just needed to add "header("Content-type: text/css"); " to my css document and it just worked :D!

Upvotes: 1

Views: 375

Answers (1)

matpie
matpie

Reputation: 17522

The CSS appears to be valid as I checked here: W3C CSS Validator and it looks right for me on Chrome. However, I did see a warning in the Chrome Developer tools:

Resource interpreted as Stylesheet but transferred with MIME type text/html.

It appears your server isn't properly setting the MIME type for CSS files.

Upvotes: 4

Related Questions