CSS Minify
What is CSS Minify?
CSS Minify refers to the process of removing unnecessary characters from CSS code without affecting its functionality. The goal is to reduce the size of the CSS file, making it faster to load on websites.
When CSS code is "minified," it strips out things like extra spaces, line breaks, comments, and sometimes even shorter variable names. This results in a smaller file size, which improves website performance, especially for mobile users and in low-bandwidth conditions.
Key features of CSS Minify
- Reduces File Size: By removing unnecessary characters, it makes the file size smaller.
- Improves Performance: Smaller files load faster, improving website speed.
- Optimises Delivery: Faster download times for end users.
Example:
Pretty-Printed CSS:
body {
background-color: #fff;
color: #333;
margin: 0;
padding: 0;
}
Minified CSS:
body{background-color:#fff;color:#333;margin:0;padding:0;}
In the minified version, all unnecessary spaces and line breaks are removed, making the CSS more compact.