[英]Why is bootstrap css using box-sizing: border-box?
I'm using only the bootstrap dropdown component but its css shrinked many of my existent layout elements and the page looks now a like damaged. 我仅使用bootstrap下拉组件,但是它的css缩小了许多我现有的布局元素,因此页面看起来像已损坏。 After a closer look I found out what's causing this:
仔细查看后,我发现是什么原因造成的:
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Why are they doing this? 他们为什么要这样做?
Remove the global reset border-box from the scaffolding area and in your dropdown css adjust the math OR in the rest of your site adjust for the border-box, so if something had a padding of 10px and a total width of 200px, the old way you'd have 180px as the width, but now just make the width the actual width and the borders are counted. 从脚手架区域中删除全局重置边框,然后在CSS下拉菜单中调整数学,或者在网站的其余部分中调整边框,因此,如果某填充的边框为10px,总宽度为200px,则旧边框您将宽度设置为180px的方式,但是现在只需将宽度设置为实际宽度,然后计算边框。 This is the same for borders too.
边界也是如此。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.