twitter-bootstrap Bootstrap 行负边距

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46453621/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 01:04:48  来源:igfitidea点击:

Bootstrap Row Negative Margin

htmlcsstwitter-bootstraptwitter-bootstrap-3

提问by Игорь Зуев

Why does Bootstrap row element have margin-left: -15pxand margin-right: -15px? When a rowelement is nested into a col-**-*element, it sticks out even on their official site. What is the best way to make a nested rownot stick out from its parent col-**-*?

为什么 Bootstrap 行元素有margin-left: -15pxmargin-right: -15px?当一个row元素嵌套在一个col-**-*元素中时,它甚至会在他们的官方网站上突出显示。使嵌套row不从其父项中伸出的最佳方法是什么col-**-*

Link to the screenshot

链接到屏幕截图

回答by Canta

You can overwrite bootstrap css rules by calling your custom stylesheet file after bootstrap's.

您可以通过在引导程序之后调用自定义样式表文件来覆盖引导程序 css 规则。

.row {
  margin: 0;
}

If you want to apply this only to rows nested into col-*

如果您只想将此应用于嵌套到 col-* 中的行

[class*=”col-”] .row {
  margin: 0;
}