Search code examples
cssconventions

Conventional Order of CSS properties


Is there a standard guideline of what order the CSS properties should be in? This would be to decide if I should use this code

p {font-size: 14px; color: purple}

or this code instead

p {color: purple; font-size: 14px}

Edit

I am now using The CSS Box Model Convention


Solution

  • There is no widely adopted convention. There is no difference between either example, so you should choose the convention you prefer. If you must really satisfy the hobgoblins, choose alphabetical or the order it affects the box model.