4 ms·
my most useful css technique: sort properties alphabeticaly within a selector.
by uggedal 17y ago
my most useful css technique: sort properties alphabeticaly within a selector.
- JoelSutherland 17y agoI sort them logically. I want width and height next to each other for example. I use this order roughly: display, position, margin/padding, border, width/height, text properties, z-index
- mcantor 17y agoWhy?
- niekmaas 17y agoFor selectors I have this order: - display - z-index - width - height - margin - padding - border - font/text - background Reasoning: I first want to define where and why an element is displaced at a certain position. I than work from the outside to the inside for styling. Lastly I define the background. I tried to have some logic but keep it a little easy to use to. ( I dont put the border in between margin and padding)