Learning Principles for Improving Your CSS

Basic principles and tips on how to learn and become better at CSS

In this article Hugo Giraudel will mostly talk about his own experience. Remember that CSS is an extremely simple language. It can be summed up in 3 words: selector, property, value. Nothing more, really. This is why some people don’t like CSS at all: because they feel like children playing with LEGOs. From what Hugo Giraudel can tell, he has been playing around with CSS for almost two years now and on what he would call a heavy level for something like 7 months. He's still far from perfect, and there are still some tricks he doesn't know or understand. Anyway, there are a few things he understood over the months and he’d like to share them with you.


  • Don’t rush your code and keep it simple
  • Know the basics and learn the tricks
  • DRY
  • OOCSS
  • CSS3: learn what you can do and what you can use
  • Progressive enhancement and graceful degradation
  • CSS preprocessors
  • Keep an eye on the future
  • Read other people’s code
  • Keep practicing

Don’t rush your code and keep it simple

This is more like a general advice, it’s not specific to CSS. When you’re about to develop something, start by thinking about it. Ask yourself a few questions: how would I do this; is there another way; how can I optimize it (to be maintainable, clean, cool, etc.). Rushing into the code may lead to time loss. What if you spent one hour creating something to realize you can’t do it this way and have to start all over again? This shouldn’t happen.

Comments

Be the first to write a comment

You must me logged in to write a comment.