Alex Rivera | Logout

Conventional Order of CSS properties

Asked 2011-02-02T19:02:50.660
23

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

Edit
Report

1 Answer

0

Not really.

But it would make sense to order alphabetically and/or group font rules and box/layout rules. Your code would be more clear.

Example:

/* font */
color: blue; font-size: 12px; word-wrap: break-word;
/* layout */
border: 1px solid red; border-bottom: none; margin-top: 6px; padding: 4px 6px;
answered 2011-02-02T19:07:28.047

Your Answer