The Trouble With Top, Right, Bottom and Left – Shorthand CSS
We have updated this post thanks to the comment made by Paul.
A few people ask me in what order do padding/margin values appear when using shorthand CSS. Many people use padding-right:10px; padding-left:10px; eg.
#left {
padding-top:20px;
padding-left:30px;
padding-right:40px;
padding-bottom:50px;
}
Well the order for shorthand CSS is Top, Right, Bottom and Left and this can be easily remembered by using the word TRouBLe – Top-Right-ou-Bottom-Left so the CSS:
#left {
padding:20px 40px 50px 30px;
}
will give the same as the first CSS example only allot shorter! As Paul quite rightly points out remeber clockwise as well!






Latest from Twitter
.. or remember it’s clockwise.
Thanks Paul clockwise is indeed much easier to remember than TRouBLe
Thanks Paul, I was googling for some way to remember this, as I always forget. I will not have any TROUBLE remembering the ccs order in future