【问题标题】:padding issue in bootstrap with fullpage.js使用 fullpage.js 在引导程序中填充问题
【发布时间】:2017-02-19 15:05:19
【问题描述】:

我有一个网页,我已经实现了fullpage.js,但问题是padding-leftpadding-right 自动添加到container-fluid,如果我删除它,左边会有一些空格。只有当我在container-fluid 中添加rows 时才会出现此问题

html

<div class="container-fluid">
    <div id="fullpage">
        <div class="row section" id="home">HomePage</div>
        <div class="row section" id="products">Products</div>
        <div class="row section" id="pricing">Pricing</div>
        <div class="row section" id="contact">Contact</div>
    </div>
    <div id="footer">Footer</div>
</div>

PS:使用引导程序 4

【问题讨论】:

  • 添加 sn-p 或实时链接。

标签: html css twitter-bootstrap fullpage.js


【解决方案1】:

.containers 旨在与 Bootstrap 中的.rows 一起工作。他们有一个聪明的系统,涉及边距和填充,它们相互抵消,但在所有设备上看起来都很好。

最简单的方法是将.container-fluid 放在#fullpage 中,而不是相反。

作为替代方案,如果由于各种原因,您不想(或不能)更改标记,您可以从 .row 转移负边距转至#fullpage:

#fullpage {
   margin-left: -15px;
   margin-right: -15px;
}
#fullpage>.row {
   margin-left: 0;
   margin-right: 0;
}

【讨论】:

  • 就是这样。谢谢芽:)
猜你喜欢
  • 2013-04-14
  • 2012-08-04
  • 1970-01-01
  • 2013-07-30
  • 2018-01-20
  • 2013-09-28
  • 2016-06-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多