What is CSS minification?
The CSS minification is the process of removing from a stylesheet's source code (.css) every character that is not strictly needed for the web browser to run it.
What does this tool remove?
- Comments: Blocks of text like
/* commentaire */that help developers but are ignored by browsers. - Spaces and line breaks: Line breaks, tabs (indentation) and the spaces around braces
{ }and colons:. - The last semicolon: The semicolon
;of the last rule in a block is not required in CSS, so it is removed to save a few bytes.
Impact on SEO (search engine optimization)
CSS is a render-blocking resource. This means the web browser pauses rendering the HTML page until it has finished downloading and reading the entire CSS file. By minifying your code, the file becomes much lighter (up to 30% savings). Your site displays faster, which directly improves your scores on Google PageSpeed Insights and helps your ranking in search engines.