In CSS, some properties (like margin
or padding
) can be described as shorthands that allow 1, 2 or 4 values.
When you use 1 value, it’s applied to every side:
When you use 2 values, they are applied to top/bottom and then left/right:
and when using all 4 values, they are applied clockwise, starting from the top:
I never remember the order so thinking about clock-wise starting from the top applies to them all - the values repeat once the list runs out.
Or like Jeremy said it:
I learned TRouBLe for top, right, bottom, left.
It made me think about Team Rocket
Prepare for TRouBLe, make margins double. To protect the world from tight spaces To unite all spaces within our <div>s