Example: The four CSS properties
margin-top: 10;
margin-bottom: 9;
margin-left: 5;
margin-right: 4;
can be written as a single property:
margin: 10 4 9 5;
Other examples are border and padding. Three suggestions for remembering the order:
- tar ball: is a mnemonic for trbl, the first characters of top, right, bottom, left.
- trouble: an alternative to tar ball, suggested by Josh Feuerstein and Rick Waldron.
- clockwise: means that you enumerate the sides of a rectangle, starting at 12 o’clock, continuing clockwise. Suggested by Franz Graf.
margin: 10 4 9 5; /* trbl */
2 comments:
Very nice. I always find hard time to remember this and I end up doing extra iterations in defining the new styles. Now I don't think I can forget this for ever. Thanks again for sharing this. :)
I usually thing of star trek tribbles for TRBL.
Note: you may want to edit your blog post soothe four properties you listed are in the proper order, just to make it a bit easier to see :)
Post a Comment