jegranet Posted February 3, 2012 Share Posted February 3, 2012 When putting padding around a box, or creating borders, in what order should you put them: ie.top, bottom, left, rightThanks.Jean Link to comment Share on other sites More sharing options...
ShadowMage Posted February 3, 2012 Share Posted February 3, 2012 Depends if you're using the shorthand. The shorthand syntax is: padding: top right bottom left; so this: padding: 5px 4px 3px 8px; would add 5px padding to the top, 4 to the right, 3 to the bottom, and 8 to the left.If there are three values: padding: 2px 3px 4px; it applies 2px to the top, 3 to left and right, and 4 to the bottom.Similarly, if there are only two values: padding: 5px 8px; it applies 5px to the top and bottom, and 8px to the left and right. If you are not using shorthand (ie, padding-left, padding-top, etc.) it does not matter what order they are in. Ie, padding-top: 10px;padding-left: 4px; is the same as: padding-left: 4px;padding-top: 10px; Link to comment Share on other sites More sharing options...
Ingolme Posted February 3, 2012 Share Posted February 3, 2012 Depends if you're using the shorthand. The shorthand syntax is:padding: top right left bottom; The shorthand starts from the top and goes clockwise. That's top, right, bottom, left. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 3, 2012 Share Posted February 3, 2012 The shorthand starts from the top and goes clockwise. That's top, right, bottom, left.:lol:Yeah, that's what I meant. I had it right when I gave the example: padding: 5px 4px 3px 8px; would add 5px padding to the top, 4 to the right, 3 to the bottom, and 8 to the left. Link to comment Share on other sites More sharing options...
jegranet Posted February 3, 2012 Author Share Posted February 3, 2012 The shorthand starts from the top and goes clockwise. That's top, right, bottom, left. Many thanks both. That's exactly what I wanted. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.