A mnemonic for the order of CSS margin and padding shorthand properties

前端 未结 22 1515
长发绾君心
长发绾君心 2021-01-30 05:20

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;
m         


        
相关标签:
22条回答
  • Try Roast Beef Leftovers ?

    0 讨论(0)
  • 2021-01-30 05:34

    Theres always the town of TRumBuLl Connecticut

    0 讨论(0)
  • 2021-01-30 05:35

    It is

    top
    right 
    bottom 
    left
    

    not what you have

    Think Right Before you Leap

    0 讨论(0)
  • 2021-01-30 05:36

    Why don't just remember that the order goes clockwise starting from the TOP:

    TOP -> RIGHT -> BOTTOM -> LEFT

    0 讨论(0)
  • 2021-01-30 05:36

    *T*op *R*amen, *B*ottom, *L*unch

    0 讨论(0)
  • 2021-01-30 05:43

    TRouBLe is best for me. And if only 3 values are shown, it's Top, Sides, Bottom - which for UK users spells TSB (the bank the government had to bail out using our money) - so TRouBLe and TSB are closely linked!

    0 讨论(0)
提交回复
热议问题