Skip to content

格式化与代码

CSS 格式化工具

免费的 CSS 格式化和压缩工具。使用 Prettier 的默认设置漂亮地打印杂乱的 CSS,或者剥离注释和空白以发布最小的样式表。适用于任何 CSS,包括 Sass 风格的选择器,在浏览器中运行。

Runs in your browser
CSS formatter & validator
lines: 0chars: 0size: 0 B
CSS · UTF-8 · 2-space indent

编辑注

Understanding · CSS, but neat.

本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。

常见问题

Quick answers.

Can it format Sass or nested CSS?

Yes — Prettier's PostCSS parser handles modern CSS features including nesting, custom properties, container queries, @supports, and more.

Is the minifier production-grade?

It's good for shipping small-to-medium stylesheets: strips comments, collapses whitespace, tightens syntax. For maximum compression (colour rewrites, shorthand collapsing) you want a dedicated tool like csso or Lightning CSS in your build pipeline.

Will it break my @media or @supports queries?

No — those are preserved and pretty-printed the same way Prettier does in an IDE.

Is my CSS sent to a server?

No — everything runs in your browser.

大家也在搜索

相关工具

More in this room.

查看所有 格式化与代码