0
whats..
whats the diference beetwen padding n margin
3 Respuestas
+ 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.
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
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.