If you could only have one mechanism, and you weren't going to lose significant functionality, it would have to be the longhand padding-top, padding-bottom, etc., set.
But I think having the shorthand rule is worthwhile.
If you could only have one mechanism, and you weren't going to lose significant functionality, it would have to be the longhand padding-top, padding-bottom, etc., set.
But I think having the shorthand rule is worthwhile.
The reason I chose the first example over the second is that, if you only ever specify padding-bottom for example, what are the default values for the other unspecified padding properties? This is why we have the CSS reset technique and normalize.css (more hackery).
I would make it mandatory that you declare all four values for the padding rule to remove any ambiguity. That would also mean eliminating shortcuts like
padding: 5px 10px 15px;
padding: 5px 10px;
I think having shorthand rules just adds to the ambiguity and complexity of CSS, because, as you rightly point out, each of the variations has a subtly different meaning from each other. This is not a good thing (in my opinion :-) especially when you consider how lengthy and complicated stylesheets are nowadays for many websites. padding: 5px;
And you actually the bottom of your element to have more padding, you need to be able to do adjust the bottom padding independently padding-bottom: 10px;
Otherwise, you'd be required to tightly couple your our padding requirements with the defaults of the original module padding: 5px 5px 10px 5px;It doesn't make much sense with "padding", but for something like "border: red solid 2px;", how do you override just the color if you don't have the individual components broken out?
I forgot that padding required explicit "inherit".
So, bottom line, yes, it would seem to make sense to just have the single-line complete version:
padding: *w* *x* *y* *z*