Media type · text/css

text/css

text/css is the media type for Cascading Style Sheets.

Key facts

Typetext/css
Extensions.css
StandardCSS Snapshot; RFC 9110
Text or binaryText
Browser behaviorApplied as a stylesheet

What text/css is

It identifies a stylesheet that the browser applies to a document. The type is required for stylesheets loaded with <link rel="stylesheet"> in standards mode: browsers perform strict MIME checking and ignore a stylesheet served with the wrong type.

Why stylesheets silently fail

A common failure is a server or CDN serving .css as text/plain or application/octet-stream. The file loads with 200 in the network panel, but the page stays unstyled. Check the response Content-Type, not the file content. The charset parameter is optional; @charset inside the file also declares the encoding.

Frequently asked questions

Why is my CSS not applied although it returns 200?

The response probably has the wrong Content-Type. Browsers refuse to apply stylesheets that are not served as text/css in standards mode.

Does text/css support charset?

Yes. charset=utf-8 is valid, and the @charset rule inside the file is an alternative declaration.

New tools, straight to your inbox

One short email when we add tools worth using. No spam, unsubscribe anytime.