6 steps to writing better CSS

Write better CSS
(Image credit: Envato/Future)

We've all been there. As you slowly open up the styles.css file of your latest CSS spectacular, you see that it’s 2,000 lines long and the class you need to change is smack in the middle.

You’re alone, scared and have no idea if it’s okay to edit that class because it could topple something on a completely different page. As a last resort you go to the end of the file and create a new class to tack onto the element that already has seven other classes on it. This is a common experience for any developer who’s been working with CSS long enough (see our favourite examples of CSS animation for some CSS inspiration).

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1