Jun 19
Remember TRBL
This post (like many I write) is mainly for myself.
When using CSS padding or margin, I generally will write margin-top, margin-bottom, margin-left, etc. I know there is easier syntax where I can specify all for with one line such as
margin: 0 10px 88px 10px;
The problem is, I can never remember which one is where. Know I’m not going to forget. It’s simply top, right, bottom, left… TRBL, TRouBLe, trouble. Who can forget trouble?
Sometime I want the top and bottom the same and the left and right the same. It is also a one liner:
margin: 10px 20px; /* top-bottom, right-left */
No, I’m not going to remember TBRL, that would be stupid. I’ll just remember to start at Top. See, no TRouBLe at all!





















July 2nd, 2008 at 4:50 pm
I can’t recall how many times I’ve neglected to use the margin attribute - for the same reason you mentioned - it’s a chore trying to remember what is what. I’m trying to get in the habit of using it now, as it can save you a considerable amount of time.