Mobile app version of vmapp.org
Login or Join
Miguel251

: Remembering CSS left, top, right, bottom When using CSS what little tricks have you done to remember (perhaps a saying?) the order of left, top, right, bottom when defining combined CSS attributes

@Miguel251

Posted in: #Css

When using CSS what little tricks have you done to remember (perhaps a saying?) the order of left, top, right, bottom when defining combined CSS attributes such as border, margin and padding.

I'm forever forgetting and Google seems populated with crap like W3Schools.

10.05% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

5 Comments

Sorted by latest first Latest Oldest Best

 

@Martha676

practice

I don't recall ever using any special method of memorization for this little tidbit. I do know I learned they were set in the clockwise order from the top, but then I proceeded to write a lot of CSS.

When you do a task repeatedly there is a tendency to memorize the details for efficiency, so at this point:


all
top&bottom right&left
top right&left bottom
top right bottom left


is second nature. Just like:

border: <width> <style> <color>;


and

background: <color> <image> <repeat> <attachment> <position>;

10% popularity Vote Up Vote Down


 

@Jennifer507

CSS is trouble. T-R-B-L Top-Right-Bottom-Left

10% popularity Vote Up Vote Down


 

@Shanna517

In addition to the straightforward winding analogy, I offer another mnemonic: Top, Right, Bottom, Left gives the initialism TRBL, pronounced terrible—or trouble if you like. (Hey, even treble gives me trouble as a baritone.) It fits in well with CRAP (Contrast, Repetition, Alignment, Proximity), the four principles of sound Web design.

10% popularity Vote Up Vote Down


 

@Heady270

I remember it by visualising a clock face: starting at 12 o'clock (top), then moving to 3 o'clock (right), then 6 o'clock (bottom) and finally 9 o'clock (left).

10% popularity Vote Up Vote Down


 

@Sarah324

They all go clockwise, starting from top.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme