tags:

views:

569

answers:

13

I can never remember the order of the shorthand property for setting the margin or padding in one declaration. That is:

margin-top:    2px;
margin-bottom: 4px;
margin-left:   3px;
margin-right:  8px;

may be written as

margin: 2px 8px 4px 3px;

Yes I understand that one can visualise the order by thinking of a clock, starting at midday and moving clockwise. But I keep forgetting about that. I need to recall the order top, right, bottom, left textually.

Hence, T B L R T R B L.

Something like This [R-noun] [B-verb] [L-nouns] is perhaps the way to go but I feel myself lacking inspiration. If anyone has come across a useful mnemonic for this I'd love to hear it. Like a good meme, I'm sure once I get something lodged in my brain I will be unlikely to forget it.

NOTE: This question gave incorrect information - the order (as noted in some of the comments and answers) is Top Right Bottom Left. (heh, see what I mean? -- dland)

+15  A: 

If you don't get it right, there will be TRouBLe

Paul Dixon
+1  A: 
DrG
+3  A: 

T R o u B L e.

Unniloct
+16  A: 

Actually the clock thing works perfectly. It is the most intuitive way to remember it, at least for me.

Yuval A
And it works pictorially too... most of the time, you're going to thinking along visual lines anyhow.
Atømix
+2  A: 

Another attempt:

Tyrannosaurus Rex : Big Lizard

Paul Dixon
+4  A: 

Tricky Rectangle Border Logic ?

Paul Dixon
I haven't heard that one before, but I like it :)
Unniloct
I'm making these up, it's slow afternoon here...
Paul Dixon
+5  A: 

Just think clockwise, it's the easiest way. Starts at the top and goes around... much easier to remember than some silly phrase (provided you know how to read a clock...)

Logan Serman
A: 

Try Roast Beef Leftovers ?

Paul Dixon
A: 

Think that you're reading Arabii or Hebrew: read from the top of the page, right to left to the bottom. ;P The good thing about this "rule" is that it works for the 3 value version too: top right-and-left bottom

Actually, i allso thought it was hard to remember, but as soon as I discovered it was the direction of the clock it was easier.

Stein G. Strindhaug
+1  A: 

Timewise Rotation, Bit Lame?

Paul Dixon
+1  A: 

The Really Big Lebowski

Paul Dixon
A: 

"Top,Right,Bottom,Left"
Really
Bad
Limerick

DrG
A: 

Theres always the town of TRumBuLl Connecticut