...

View Full Version : padding shortcut--when to use?



Tricia
12-11-2006, 03:54 PM
in css--

padding: 5px;

vs.

padding: 5px 5px 5px 5px;

what's the advantage of using one over another other than less typing?

rmedek
12-11-2006, 04:00 PM
Less typing. ;)

Other than that, none really… I mean, you save some bandwidth I guess but unless you're working with a huge stylesheet the difference is negligible. I'm not exactly sure what extra processing the browser requires to compute the rule (i.e. decode "padding: 5px" to mean "padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px;".



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum