Use a CSS Reset
CSS resets help enforce style consistency across different browsers with a clean slate for styling elements. You can use a CSS reset library like Normalize, et al., or you can use a more simplified reset approach:
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
Now elements will be stripped of margins and padding, and box-sizing
lets you manage layouts with the CSS box model.
Demo
Note: If you follow the Inherit box-sizing
tip below you might opt to not include the box-sizing
property in your CSS reset.
当前内容版权归 AllThingsSmitty 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 AllThingsSmitty .