View Full Version : CSS padding

06-03-2005, 05:04 PM
What exactly is padding? Why is it used? Just curious.



06-03-2005, 05:43 PM
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.

<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>

<p style="margin:10px;border:1px solid #000;">There is a 10px margin around this paragraph.</p>