Online CSS Editor
Free online CSS editors and code generators. CSS Editor is the best place to clean and organize messy CSS styles. Paste your code in the editor and select the desired cleaning options to tidy up your code instantly.
These advanced CSS editing tools empower you to optimize and maintain your stylesheets with ease, saving you time and effort while ensuring high-quality code and consistent design across your website. Whether you're a seasoned developer or just getting started with CSS, our Online CSS Editor has everything you need to streamline your workflow and create beautiful, efficient web designs.
CSS Cleaning Options
The most commonly used options are listed below the syntax highlighted code editor. Most commonly you either want to compress the code or to make it more readable: Minify and tidy up.
Mini Mini - It compresses the CSS code but puts each rule block in separate line to keep it more readable. It does the same job as executing the following three cleaning options: "Compress", "Line break after }", and finally "Remove comments".
Tidy Tidy - Unfolds the compressed code, setting indentations in the code to make it appealing for the eye.
Further Cleaning Options
The more specific CSS cleaning options are listed on the right side of the editor. You can pick and execute each option clicking it.
- Compress – The most efficient CSS compressor which also makes the code hard to read for the human eye. It shrinks the styles in one line but it doesn't remove the comments.
- Line break after } – It makes the compressed styles more readable, putting each rule in a separate line.
- Remove comments – Get rid of comments, written in /*...*/
- Remove last ; before } – The semicolon in each block can be removed to save some space.
- Delete white characters – Removing unnecessary spaces and line breaks can further reduce the size of your CSS file.
- Space before !important – Some CSS files put an empty space before the !important attribute, others don't. You can tidy up your code putting a space before each instance.
- Delete @media blocks – Deletes @media blocks and their contents. You can use this if you want to start from scratch making a page responsive.
- Numeric font-weights – Font-weight attributes can be expressed with text, but also with numbers: (light, normal, bold) = (100, 400, 700)
- Color names to hex – Avoid using color names, because different browsers might interpret them differently or might not understand them at all. Use their hex code instead to avoid confusion. Ex: brown = #A52A2A, medium spring green = #00FA9A
- Space after : - Put an empty space after colons to make the code more readable. You can also remove them compressing your code.