tags:

views:

38

answers:

4

what are the differences between margin and padding.

Thanx

+3  A: 

Padding is inside of the border, margin is outside. See the W3C Box model for details.

This blog post is much more readable, though :-)

Aaron Digulla
+1  A: 

Its always better you will learn your self instead of explaining what it is.

In firefox there is an addon called Firebug. Just create a sample DIV or Input element. Try to add padding and Margin to this. You can check what is changing.

For IE browser there is Developer toolbar. You have got lot of tools where you can see the live demo yourself.

Multiplexer
+1  A: 

The simplest defenition is ; padding is a space given inside the border of the container element and margin is given outside. For a element which is not a container, padding may not make much sense, but margin defenitly will help to arrange it.

Wind Chimez
A: 

When you pack something breakable to mail, you put padding around the item (content) to cushion it.

Then, just know the 'other one is space oustide the box' in this case margin.

Billy