css - bootstrap 中的这个 CSS 是做什么的?

标签 css twitter-bootstrap-3

所以我有一些 Jquery UI 可拖动跨度元素,在将 Bootstrap 3.0 添加到我的网站后,它们的高度缩小了,这是一个问题,因为它们是我的文档标记/定位应用程序的一部分,需要保持相同的高度.我发现罪魁祸首是:

*,
*:before,
*:after {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

在 Bootstrap.css 中。如果我注释掉 -webkit-box-sizing: border-box;, box-sizing: border-box;或 -moz-box-sizing: border-box;单独我的问题仍然存在,但如果注释掉整个样式,我的可拖动元素的高度将返回到它们的原始高度。

我可以像这样覆盖此样式以恢复我的 ui-draggable span 元素的高度:

*,
*:before,
*:after {
  -webkit-box-sizing: content-box;
     -moz-box-sizing: content-box;
          box-sizing: content-box;
}

内容框和边框框有什么区别?

最佳答案

content-box width, padding, border, margin 是content box model

中的个别内容

enter image description here border-box:border box模型包括border和width内的padding。

enter image description here

关于css - bootstrap 中的这个 CSS 是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20079898/

相关文章:

css - 如何不拉伸(stretch) flex div 子项的高度

jquery - 如何在释放 mousedown 时停止 jquery 动画?

javascript - Bootstrap 未在 Angular 部分页面上加载

html - 为图像创建双圆边框

css - Twitter bootstrap - 使表行不活动

html - 为什么我的图像不会扩展到 div 的完整大小?

html - Bootstrap/HTML - 说明

css - 调用 mixin SASS 而不是 @include 的更简单方法

javascript - 是否有任何JavaScript 'packs' 可以使CSS3 在IE 浏览器上兼容?

css - 如何根据屏幕尺寸对列进行排序?