whats.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

whats..

whats the diference beetwen padding n margin

12th Jul 2016, 3:42 AM
Kevin Eduardo Oleaga Garcia
Kevin Eduardo Oleaga Garcia - avatar
3 Answers
+ 2
Let me explain this using something tangible. Think of shoes inside a shoe box. The shoes are your elements; in this example I will refer to them as contents (i.e. paragraph <p>, anchor <a>, list <li>, etc.) and the box is your border. The space between the edge of your shoes and the box is your padding. You may choose to change this (padding) space which in turn affects the size of your box. No need to get a new box. Your original box automatically expands and contracts depending on the size of your content and the padding that you set. Now, margin could be think of as the space between the wall in your closet and your box, as well as its distance from other boxes and contents in your closet. Changing the margin size does not affect the size of your box but it does affect its distace against the other items next to it. Hope this helps.
16th Jul 2016, 2:38 AM
ham26mg
0
padding is space between your text and box and margin is for calculate your box position, where you placed your box, by giving margin
12th Jul 2016, 10:34 AM
neeti
neeti - avatar
0
In a framed picture the margin is outside the frame and the padding is the white distance from the picture to the frame. Hope that makes it easy to understand.
2nd Sep 2016, 11:56 PM
Altaiir
Altaiir - avatar