自举容器流体填充 [英] Bootstrap container-fluid padding
本文介绍了自举容器流体填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下HTML生成了不必要的填充:
The following HTML is generating unwanted padding:
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
test
</div>
</div>
</div>
屏幕截图显示了问题所在:
推荐答案
这里没有答案对我有帮助使用Bootstrap 4。
None of the answers here helped me with Bootstrap 4.
添加容器流体p-0
删除了水平填充,但是创建了一个水平滚动条。
Adding container-fluid p-0
removed the horizontal padding, but created a horizontal scrollbar.
滚动条来自行元素的负边距-宽度为100%的容器,没有填充物,每边延伸15px。据我所知,它与列填充无关。
The scrollbars come from the negative margin of the row elements - a 100% width container with no padding gets stretched by 15px on each side. It has nothing to do with column padding, as far as I can see.
对我而言,唯一的解决方法是
The only workaround for me was
.container-fluid {
溢出:隐藏;
}
这篇关于自举容器流体填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文