This article is all about CSS code structure - specifically about a method I've been using for the last few years to bring some logic and consistency to the order in which I write my CSS. It’s a method I call “Outside In”. Declaration Order? I've heard of various approaches to writing CSS in the past. Some people don't use any particular order at all, others alphabetise declarations by property name, I've even heard of a handful of cases where some order them visually by the length of each property:value pair! A past poll on CSS-Tricks asked this question with a result that I found quite surprising: 39% of over 11,000 people have no specific plan when it comes to ordering CSS. How do you order your CSS properties? Total Voters: 11,093 Grouping by type might suggest height being next to width .
↧