Minifying your CSS files

What is minification and why minify your CSS files?

When you minify a CSS file you're reducing the size of the file which makes it faster as it can render much more quickly.

Minifying reduces the file size by deleting whitespace, comments, line breaks and anything unnecessary for the program to run which only makes the code more readable to the human but actually makes the file larger which isn't ideal for browsers because it may affect the time it takes to load the page, especially with larger projects.

Why it's important

Nobody likes a website that takes some time to load and in many cases, they'd just leave the website.
It also improves SEO (Search Engine Optimisation) – how websites rank your website in search results.
Faster load times will boost your website's ranking with search engines and this is one way to improve the speed at which your webpage loads.

How to minify your CSS files?

You could do it manually but that's not ideal, especially with a huge project but luckily there's some great tools online that can do the work for you.
You can just run your code through a website like CSSminifier.com which makes the process much easier.

Any questions, post them below!

Comments

Popular posts from this blog

CSS Flexbox made simple (Part 1)

Welcome