Search code examples
cssconventions

CSS Ordering Convention for which tags to specify first


I typically place the rules in my CSS in the same order as they are in the HTML. But what about global rules like how I format my input,textarea,p,tr,th and stuff like that? Is there a convention on which order the rules should go in?

Obviously there are situations when the rules have to be in a certain order to work.


Solution

  • I use one line per rule notation now, try to keep it organized and easy to read. It minimizes scrolling and it is easier to sort the rules that way.