Any conventions on how to organize CSS code?

In which order should I write all my tags and classes and IDs?

If I have several tags, I organize them by hierarchy (first h1, then h2,… p,…). What about classes and IDs?

Thank you :slightly_smiling_face:

3 Likes

You may organize them to your hearts content. Hierarchy aids to readability for sure. What I tend to do is use comments between the lines to categorize the tags and group them into sections representing parts of the website.

3 Likes