What Is This?
The text/css MIME type indicates that the content is a Cascading Style Sheet. When a browser encounters a <link> element or @import rule with text/css, it downloads and applies the stylesheet rules to the HTML document.
Common Uses
External stylesheet files linked in HTML documents
CSS framework files (Bootstrap, Tailwind)
Inline <style> blocks in HTML
CSS preprocessor output files
Examples
Supported by all browsers. CSS is a core web technology.
The .css file extension maps to text/css as its MIME type.
Related Entries
More from this reference:
text/html
The MIME type for HTML documents, the standard markup language for web pages.
text/plain
The MIME type for plain text files with no formatting or markup.
text/javascript
The MIME type for JavaScript source files used to add interactivity to web pages.
text/csv
The MIME type for Comma-Separated Values data files.
Frequently Asked Questions
What happens if CSS is served with the wrong MIME type?
Browsers may refuse to apply stylesheets served with incorrect MIME types. If the Content-Type is text/plain or application/octet-stream, the browser blocks the stylesheet for security reasons.
Can I use application/x-css instead of text/css?
No. text/css is the only correct MIME type for CSS. Using application/x-css or other types may cause the browser to reject the stylesheet.