# Refused to apply style ... because its MIME type

> Chrome refuses a stylesheet whose Content-Type is not text/css. Check the response in DevTools or curl, then fix SPA fallbacks, nginx mime.types and AddType.

Canonical: https://scaplet.com/errors/browser/refused-to-apply-style-from-because-its-mime-type

Guide Error · Browser errors

Chrome refuses a stylesheet whose Content-Type is not text/css. Check the response in DevTools or curl, then fix SPA fallbacks, nginx mime.types and AddType.

3 min

read

8

sources

Oct 31, 2026

updated

Scaplet Editorial Team

author

In one line

Chrome refuses to apply a stylesheet when the response's `Content-Type` is not `text/css`. The usual cause is that the CSS URL returned something else, most often your `index.html` or an error page from a catch-all rewrite, or a server that sends the wrong type for `.css`. Request the file with `curl -I`, check the type and status, then fix the server rule.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fbrowser%2Frefused-to-apply-style-from-because-its-mime-type%20(%22Refused%20to%20apply%20style%20...%20because%20its%20MIME%20type%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fbrowser%2Frefused-to-apply-style-from-because-its-mime-type%20(%22Refused%20to%20apply%20style%20...%20because%20its%20MIME%20type%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fbrowser%2Frefused-to-apply-style-from-because-its-mime-type%20(%22Refused%20to%20apply%20style%20...%20because%20its%20MIME%20type%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fbrowser%2Frefused-to-apply-style-from-because-its-mime-type%20(%22Refused%20to%20apply%20style%20...%20because%20its%20MIME%20type%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 3 minutes.

1. [Two rules cause this, and both look at Content-Type 01](#two-rules-cause-this-and-both-look-at-content-type)
2. [Reproduce and read the response 02](#reproduce-and-read-the-response)
3. [Fix it on your server 03](#fix-it-on-your-server)
4. [Check the result 04](#check-the-result)

_01_Mechanisms that refuse a stylesheet

## Two rules cause this, and both look at Content-Type

The browser decides from the response header, not from the file name. Two documented mechanisms can reject a stylesheet whose type is wrong. I could not verify Chrome's exact console wording against a vendor page, so match the message by its meaning: a stylesheet was not applied because of its MIME type.

Mechanism

### `X-Content-Type-Options: nosniff`

What the source says

MDN: for requests with a destination of "style", the browser blocks the response if the MIME type is not `text/css`. The Fetch Standard step reads: if the destination is "style" and the MIME type's essence is not "text/css", return blocked

How to spot it

The response has `X-Content-Type-Options: nosniff` and a different `Content-Type`

Mechanism

### Strict stylesheet MIME check in Chromium

What the source says

In Chromium's `CSSStyleSheetResource::CanUseSheet`, with strict checking the sheet is used only if the `Content-Type` is empty, `text/css` or `application/x-unknown-content-type`. The comment says this matches Firefox

How to spot it

No `nosniff`, but the CSS URL returns `text/html` or `text/plain`

**Most of the time the file is not CSS at all**If your server rewrites unknown URLs to `index.html`, a wrong stylesheet path returns your HTML page with status 200 and `Content-Type: text/html`. The fix is the path or the rewrite rule, not the MIME type.

_02_How it works

## Reproduce and read the response

Check the type the server sends

```
curl -sSI https://example.com/assets/app.css | grep -i -E "^HTTP|content-type|x-content-type-options" # Expected # HTTP/2 200 # content-type: text/css # Wrong # HTTP/2 200 # content-type: text/html <- catch-all rewrite served index.html
```

1. 01

### Find the failing URL

Open DevTools, go to the Console, and click the stylesheet URL in the message, or open the Network tab and filter by CSS.
2. 02

### Read status and headers

In the Network tab, select the request and check the Status, `Content-Type` and `X-Content-Type-Options` response headers.
3. 03

### Repeat it with curl

Run the command below. A 404 or `text/html` body means a wrong path or a catch-all rewrite; `text/plain` means the server does not map `.css`.

_03_Fix it on your stack

## Fix it on your server

nginx: load the full MIME table, and do not rewrite real files
nginx: load the full MIME table, and do not rewrite real files

```
http { # Without this, nginx's built-in table has only html, gif and jpg, # and other extensions get default_type (text/plain by default) include mime.types; default_type application/octet-stream; server { location / { # Serves a real file if it exists; only unknown paths fall back try_files $uri /index.html; } } }
```

Apache: map the extension, and use FallbackResource for SPAs
Apache: map the extension, and use FallbackResource for SPAs

```
AddType text/css .css # Existing files such as CSS and images are served normally; # only requests that map to nothing go to index.html FallbackResource /index.html
```

Express: serve assets from a static directory
Express: serve assets from a static directory

```
const express = require('express'); const app = express(); // Files in ./public are served by their path, e.g. /assets/app.css app.use(express.static('public')); app.listen(3000);
```

nginx documents the `types` directive as mapping file name extensions to MIME types, distributing a full table in `conf/mime.types`. If a request for a CSS file returns `text/html`, look at your `try_files` or `FallbackResource` target and your build's public path, because a typo in the stylesheet URL lands on the fallback.

**Do not remove nosniff to silence this**MDN explains that `nosniff` also stops user-uploaded content from being executed as HTML. Fix the `Content-Type` instead. Related reading: [security headers](/glossary/security-headers).

_04_Checklist

## Check the result

First_2_
`curl -sSI` on the stylesheet returns 200 and `content-type: text/css`

Hard reload with DevTools open and Disable cache ticked, and the console message is gone

Next_1_
Test a deliberately wrong CSS path: it should return a 404, not your home page. See [404 not found with .htaccess](/errors/http/404/htaccess) for Apache rewrite causes

Then_1_
If a CDN sits in front, request through the CDN hostname too, since it can cache a wrong response

Sources · 8

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- mozilla.org
- whatwg.org
- googlesource.com
- nginx.org
- apache.org
- expressjs.com

1. 01 [MDN: X-Content-Type-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options) developer.mozilla.org · checked 2026-11-01
2. 02 [Fetch Standard: Should response to request be blocked due to nosniff?](https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff?) fetch.spec.whatwg.org · checked 2026-11-01
3. 03 [Chromium source: css_style_sheet_resource.cc](https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/loader/resource/css_style_sheet_resource.cc) chromium.googlesource.com · checked 2026-11-01
4. 04 [MDN: MIME types (media types)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types) developer.mozilla.org · checked 2026-11-01
5. 05 [nginx: ngx_http_core_module (types, default_type, try_files)](https://nginx.org/en/docs/http/ngx_http_core_module.html) nginx.org · checked 2026-11-01
6. 06 [Apache httpd 2.4: mod_mime (AddType)](https://httpd.apache.org/docs/2.4/mod/mod_mime.html) httpd.apache.org · checked 2026-11-01
7. 07 [Apache httpd 2.4: mod_dir (FallbackResource)](https://httpd.apache.org/docs/2.4/mod/mod_dir.html) httpd.apache.org · checked 2026-11-01
8. 08 [Express: Serving static files](https://expressjs.com/en/starter/static-files.html) expressjs.com · checked 2026-11-01

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ Why does my CSS come back as text/html?

Usually the URL does not match a file and a catch-all rule serves `index.html` or an error page instead. Check the stylesheet path and the rewrite or fallback rule.

_02_ What does nosniff have to do with stylesheets?

With `X-Content-Type-Options: nosniff`, browsers block a response used as a stylesheet if its MIME type is not `text/css`, per MDN and the Fetch Standard.

_03_ Why is my CSS served as text/plain on nginx?

If `mime.types` is not included, nginx uses its small built-in `types` table and falls back to `default_type`, which defaults to `text/plain`. Add `include mime.types;` in the `http` block.

_04_ Does this hurt SEO?

I did not find Google documentation on this specific error, so I make no claim. Blocked CSS is a [rendering](/glossary/rendering) problem for visitors, and you can check how Google renders the page with its [URL inspection](/glossary/url-inspection-tool) tools.

## Keep learning

[All errors](/errors)

[Learn 404 Not Found caused by .htaccess HTTP status codes](/errors/http/404/htaccess) [Related Security headers Technical SEO](/glossary/security-headers) [Read next 404 Not Found HTTP status codes](/errors/http/404) [Do Run a free site audit Free, about two minutes](/site-audit)

More in Browser errors
[Access-Control-Allow-Origin](/errors/browser/access-control-allow-origin) [Aw, Snap!](/errors/browser/aw-snap) [blocked:mixed-content](/errors/browser/blocked-mixed-content) [Chrome out of memory](/errors/browser/chrome-out-of-memory) [Firefox Server Not Found](/errors/browser/firefox-server-not-found) [Firefox: "Secure Connection Failed"](/errors/browser/firefox-secure-connection-failed) [Firefox: File not found](/errors/browser/firefox-file-not-found) [Firefox: the connection has timed out](/errors/browser/firefox-the-connection-has-timed-out) [Firefox: Warning: Potential Security Risk Ahead](/errors/browser/firefox-warning-potential-security-risk-ahead) [Refused to apply style ... because its MIME type](/errors/browser/refused-to-apply-style-from-because-its-mime-type) [Safari can't find the server](/errors/browser/safari-can-t-find-the-server) [Safari can't open the page](/errors/browser/safari-can-t-open-the-page) [Safari: "This Connection Is Not Secure" and related warnings](/errors/browser/safari-this-connection-is-not-private) [SSL certificate problem: unable to get local issuer certificate](/errors/browser/ssl-certificate-problem-unable-to-get-local-issuer-certificate) [Text content does not match server-rendered HTML](/errors/browser/text-content-does-not-match-server-rendered-html) [This page isn't working](/errors/browser/this-page-isn-t-working) [This site can't provide a secure connection](/errors/browser/this-site-can-t-provide-a-secure-connection) [Uncaught ReferenceError: x is not defined](/errors/browser/uncaught-referenceerror-is-not-defined) [Uncaught TypeError: Cannot read properties of undefined](/errors/browser/uncaught-typeerror-cannot-read-properties-of-undefined) [Your connection is not private](/errors/browser/your-connection-is-not-private) [Your connection is not private in Chrome (on every site)](/errors/browser/your-connection-is-not-private-chrome)

Terms on this page
[Security headers](/glossary/security-headers) [Rendering](/glossary/rendering) [URL Inspection tool](/glossary/url-inspection-tool)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
