RevealTheme logo

Trình định dạng và làm đẹp CSS

Định dạng CSS đã được nén với thụt lề, ngắt dòng và khoảng cách phù hợp.

Cách sử dụng công cụ này

  1. 1

    Paste your minified or unformatted CSS into the text box.

  2. 2

    Read the formatted result that appears instantly in the output panel below.

  3. 3

    Select the output text and copy it (Ctrl/Cmd+C) into your stylesheet or editor.

  4. 4

    Tweak the input and the output re-formats live as you type.

Trình định dạng và làm đẹp CSS là gì?

CSS đã được nén là một dòng đơn với toàn bộ khoảng trắng bị loại bỏ. Công cụ này khôi phục khả năng đọc: mỗi thuộc tính nằm trên dòng riêng, được thụt lề bên trong dấu ngoặc nhọn và có một dòng trống giữa các quy tắc. Đầu ra có chức năng giống hệt, chỉ là dễ đọc hoặc chỉnh sửa hơn.

Các trường hợp sử dụng phổ biến

  • Un-minifying a production .css file you pulled from a CDN so you can read what a rule actually does.

  • Cleaning up CSS that was pasted as a single line out of browser DevTools or a build artifact.

  • Tidying inconsistent indentation in a hand-edited stylesheet before committing it to version control.

  • Making a vendor or third-party widget stylesheet legible enough to override specific properties.

  • Preparing a readable CSS snippet to paste into a blog post, tutorial, or Stack Overflow answer.

  • Quickly inspecting the structure of an unfamiliar stylesheet to find where a selector is defined.

Câu hỏi thường gặp

Nó có giữ lại các chú thích không?
Các chú thích dạng khối (/* ... */) được giữ lại nguyên văn tại vị trí ban đầu của chúng.

Công cụ liên quan