Tuesday, October 4, 2011

CSS: Margin and Padding Shorthand

I asked myself: In which order are the 4 values listed, and it took me a while, to find a serious statement on this.

From CSS: The Missing Manual, Second Edition.

… You’ll frequently want to set all four sides of a style’s margin or padding. …
… The order in which you specify the four values is important. It must be top, right, bottom, and left. If you get it wrong, you’ll be in trouble. In fact, the easiest way to keep the order straight is to remember to stay out of TRouBLe—top, right, bottom, and left. …

No comments: