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

Thread: CSS padding

  1. #1
    Registered User
    Join Date
    Mar 2005
    Location
    Yucaipa, California
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS padding

    What exactly is padding? Why is it used? Just curious.

    Thanks.

    _chris

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    padding is the space from the INSIDE of the element where as margin is the the space that is on the OUTSIDE of the element. Do some simple examples.
    Code:
    <p style="padding:10px;margin:0;border:1px solid #000;">There is some text in here spaced out 10px from the inside of the borders edge.</p>
    Code:
    <p style="margin:10px;border:1px solid #000;">There is a 10px margin around this paragraph.</p>


  •  

    Posting Permissions

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