覆盖的CSS仍在应用

时间:2017-11-12 10:29:02

标签: html css twitter-bootstrap

我正在使用bootstrap来设计我的网页。我已经用元素的样式覆盖了.row的属性。但它仍然出现了。

enter image description here

如您所见,上图中的x轴上有一个滚动条。但是当我在chrome的开发工具上检查元素并取消选中.margin-right时,它就会消失。

enter image description here

我已经检查了开发工具中的每个元素,并且没有超过网页宽度的元素。

我甚至试过这个剧本,

var docWidth = document.documentElement.offsetWidth;

[].forEach.call(
  document.querySelectorAll('*'),
  function(el) {
    if (el.offsetWidth > docWidth) {
      console.log(el);
    }
  }
);

此处建议 - https://css-tricks.com/findingfixing-unintended-body-overflow/ 这在控制台中显示undefined。请帮助我理解这是如何实现的。 margin-right属性也已经在开发工具中得到了突破。

2 个答案:

答案 0 :(得分:0)

使你的内联css像这样:

style="margin-right:0px !important"

这样可行。

答案 1 :(得分:0)

我很确定你使用的是bootstrap库。

要应用row及其列system,您需要容器。像这样:

<div class="container">

<div class="row">
 // here goes the column
</div>

</div>