Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我将 box-sizing 属性用于边框框,它是否会使边距和填充重置为 0 无关紧要,还是我应该做的事情?
IE
* { box-sizing: border-box; margin: 0; padding: 0; }
它仍然是相关的,因为盒子模型只是改变了你的边距/填充/边框在宽度和高度上的计算方式。
当你设置 box-sizing:border-box; 在一个元素上,该元素的填充和边框不再增加其宽度。
检查一下:- http://learnlayout.com/box-sizing.html