+ 5
What is different between margin and padding?
9 Antworten
+ 19
margin is the space an element take from its outside and padding is the space it takes from inside.
+ 10
Margin is the space between the border of the element with the border of other elements whereas padding is the area between the content and border of the element
+ 3
Padding is space between content and border. Margin is space between border and another element.
Suppose a box has a object inside it, here six walls of box is border and object inside it is content for CSS. Padding is space between object and walls of box(there may be different padding/space from different sides). If you keep that box in your cupboard little bit away from another box or even wall of cupboard, that space is margin of box.
+ 2
Padding is physical white space that objects obey. Margin is transparent space where other objects can be placed
+ 2
if you ad a background color it will cover padding and not margin.
+ 2
Basically margin is the outer most part of a box model. Padding is deep inside coming only after the border.
+ 1
margin is the space taken before the border of a box & padding is the space specified inside of a box
0
Margin represent the space between elements. whereas padding is a space inside the element which holds the content away from the edges of the box.
- 6
No difference. both are spacing left out from edges of, say, a paper, a square, a box, a division etc, so that your contents won't get too close , and looks better!