Find a Question:
Difference between Margin and Padding
Sep
22
2011
Answer this Question
You must be Logged In to post an Answer.
Not a member yet? Sign Up Now »
Recent Answers
- Meg Luedecke on Who is the best foreclosed homes website search engine?
- Ally on What are differences of penguins from eagles
- jeremywagner83 on Difference between Bylaws and Constitution
- Hello - Its me on Difference between Democrat and Republican
- admin on Difference Between Pneumonia and Walking Pneumonia
Become our fan
Star Points Scale
Earn points for Asking and Answering Questions!
[1 - 25
[26 - 50
[51 - 500
[501 - 5000
[5001 - 25000
[25001+ 
Answer #1
Most people are unable to differentiate between padding and margin. Are there any differences between CSS margin and CSS padding? Do they have some similarities? Well, the two are totally opposite. To help you differentiate between the two, padding is inside the element control whereas margin is outside the element control. Read on and learn more differences between these two puzzling terms.
Padding
In most cases padding is applied when you want to create spaces within the element of control and the boundary of element control. The content within a control could either be text or child control. Padding is used to create additional space towards the inner area within the control.
Margin
In contrast, margin is applied to help distance the boundaries within the element control. It shields all other controls that are outside it. It also defines the spaces between the boundary and other outside elements.
In other words, you need margins to place the contents inside a div or html tag. Nonetheless, when you want to place div tags as a whole, then you have to use padding. This is a winded description that will hopefully correct the differences between margins and HTML padding.
Typically, margins are the spaces around a specific element and inner space of an element. On the other hand, padding is the inner space whereas Margin is the space on the outside.
During web design, you should ensure you use correct layout so that all page elements are placed in the appropriate order and position. Sometimes, you have to add div margins or div padding to keep div tags in their correct positions.
Summary:
1. Margin is described as the space on the outside while padding is the inner space of an element.
2. They are both used in web design to help you use proper layout so that all page elements are placed in the appropriate order or position.