Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    padding shortcut--when to use?

    in css--

    padding: 5px;

    vs.

    padding: 5px 5px 5px 5px;

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

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    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;".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •