DevKits

text/*

text/css

File extensions: .css

Cascading Style Sheets — page styling rules.

What is text/css?

text/css is the media type for CSS stylesheets served as external <link rel="stylesheet">. Browsers will refuse to apply a stylesheet if the server declares any other type — a common misconfiguration.

Typical usage

External stylesheets linked from HTML pages.

Common gotchas

Serving .css files as application/octet-stream (a common misconfiguration on static hosts) causes browsers to silently skip the stylesheet.

HTTP header example

Response header

Content-Type: text/css; charset=utf-8

Reference

RFC 2318

Frequently asked questions

What is the text/css MIME type?

text/css is the media type for CSS stylesheets served as external <link rel="stylesheet">. Browsers will refuse to apply a stylesheet if the server declares any other type — a common misconfiguration.

What file extension does text/css use?

Files served as text/css typically use the extension .css. The most common is .css.

How do I set the Content-Type for text/css?

Send the HTTP response header Content-Type: text/css; charset=utf-8. External stylesheets linked from HTML pages.

Is text/css an official MIME type?

Yes. text/css is officially registered with IANA (RFC 2318), so standards-conformant clients recognize it.

What are common mistakes with text/css?

Serving .css files as application/octet-stream (a common misconfiguration on static hosts) causes browsers to silently skip the stylesheet.

Related MIME types

Handle text/css with these tools