Hi, I was just wondering after looking at these three boxes and how their seperated
currently their separated by padding-right: 7px;padding-left: 7px. Would it be wrong to use margin-right:7px, margin-left: 7px, or is it just personal choice?
Hi, I was just wondering after looking at these three boxes and how their seperated
currently their separated by padding-right: 7px;Hi,
It probably wouldn’t make any difference in that case.
Padding is the space inside the element and margin is how far away from other elements that element is. If there are no backgrounds or borders on the element then padding or margin will keep the elements spaced apart although in the case of vertical margins you will get a margin collapse effect on most elements (e.g. if an element has a top and bottom margin of 7px then the elements will only be 7px apart vertically but if they had 7px top and bottom padding then they would be 14px apart as padding never collapses).
In your example above I would have been inclined to apply a margin:0 7px to the middle item only.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.