Our site remains ad-free thanks to our affiliates. This post's featured affiliate is Namecheap. Namecheap offers domains at low prices while providing outstanding customer service.
The post is not sponsored by the above affiliate and the content here is not representative of their company.
What is Code Compression
The most common code compressors will simply remove unneeded white-space such as tabs, spaces and line breaks. Inside of CSS, you can also optimize color codes from the six character codes to the three character codes (#FF0000 to #F00). This only works color codes where the two bytes next to each other are the same. Also in CSS, the last semicolon in a section can be omitted. That’s another few easy bytes you can regain.
Below are a few resources available for code compression. Just make sure when you do compress your code, you keep the original file also. You won’t be able to easily modify the compressed code.
- CSS Compressor: A very basic and miniamlist compressor. Very easy to use but does lack some options that other compressors have.
- Minify CSS: A very featured rich compressor with options on save to file or show the output. Also can modify selectors and join them together to help compress your CSS even further.