首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >bootstrap全宽。div占用的空间更少

bootstrap全宽。div占用的空间更少
EN

Stack Overflow用户
提问于 2016-01-01 03:15:18
回答 3查看 817关注 0票数 0
代码语言:javascript
复制
<div class="row">
   <div class="col-lg-12">
      <div class="container-fluid top">
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting        industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typ
        </p>
     </div>
    </div>

我已经把col 12给了一个div,但是在给出位置的时候:修正了为什么它是最小尺寸的。为什么我仍然需要给出宽度:100%给div。

EN

回答 3

Stack Overflow用户

发布于 2016-01-01 03:31:08

您的正确架构(并非总是,但在大多数情况下)是:

容器-行-列

所以在这种情况下,它应该是这样的:

代码语言:javascript
复制
 <div class="container-fluid">
    <div class="row">
      <div class="col-lg-12">
         <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typ
         </p>
      </div>
    </div>
 </div>

现在,如果文本没有一直到边缘,是因为col lg-*类有15px的间隔填充。只需删除col-lg-*类,您将得到没有填充的行。

查看我的

编辑

归功于Tim Lewis

容器和容器流体的边距均为15px,行的边距为-15px。请确保不要以-15px或30px的边距结束,这取决于您如何使用它们

票数 1
EN

Stack Overflow用户

发布于 2016-01-01 03:38:45

一个简单的Bootstrap架构,比如

代码语言:javascript
复制
<div class="container-fluid">
  ...
</div>

您可以在http://getbootstrap.com/css/#overview-container上查看更多信息

票数 1
EN

Stack Overflow用户

发布于 2019-10-11 15:41:23

我认为它应该被更正为

代码语言:javascript
复制
<div class="container-fluid">
  <div class="row">
    <div class="col-lg-12">
    </div>
  </div>
</div>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34550731

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档