margin 和 padding 的使用场景

千锋教育

需要在border外侧添加空白,且空白处不需要背景(色)时,使用 margin;


需要在border内测添加空白,且空白处需要背景(色)时,使用 padding。