【问题标题】:I need to increase the size of a span or div in twitter bootstrap [closed]我需要在twitter bootstrap中增加span或div的大小[关闭]
【发布时间】:2013-10-15 16:28:47
【问题描述】:

我需要在我的 twitter 引导布局中增加 span 或 div 的大小, 布局流畅,基本上我要做的就是消除屏幕右侧的间隙。

【问题讨论】:

  • 请更具体一些,并提供一些代码来显示您到目前为止所尝试的内容。从您提供的内容中分辨出您的要求有点困难。毕竟,几乎所有的布局容器都是“span or div”。
  • 代码在 viewsource 中。我更改了流体容器以删除 padding-left:0;并删除 padding-right:0;
  • 我删除了我的旧答案,因为它没有回答问题(误解了它)。我相信新版本解决了实际问题。

标签: html css twitter-bootstrap


【解决方案1】:

您需要增加.span9 div 的大小,使其填满.row-fluid

.row-fluid .span9 {
    width: 77.01%; //Adjust this as necessary if there is more blank space.
}

这只是必要的,因为您使用margin-left: -2px 手动修改了.span9 的边距。

【讨论】:

    【解决方案2】:

    试试这个以充分利用您的设计:

    1. 在 bootstrap.css 行号 4560 中删除:

      padding-left: 0;
      padding-right: 0;
      
    2. 您有两种选择:

    一个。移除 ma​​rgin-left: -2px; 以便移除屏幕右侧的间隙但您的右侧之间会有边距侧面和左侧。

    b.如果您不需要右侧和左侧之间有边距,则必须将 bootstrap-responsive.css 中的第 251 行 的值更改为等于 77% 或使用价值来为您的网站获得最佳数字。

    最后的解决方案是包装你的 (跨度 3 和跨度 9) 并使包装器的宽度为 100%。

    例如:

    <div class="container-fluid">
        <div class="row-fluid">
          <div class="anyClassName">  <!-- wrapper -->
           <div class="span3"> your code her </div>
           <div class="span9"> your code her </div>
          </div>    <!-- /wrapper -->
        </div>
    </div>
    

    然后使用您的 css 代码定位该类,例如:

    .anyClassName {
     width: 100%;
    }
    

    希望这会对你有所帮助。

    【讨论】:

      猜你喜欢
      • 2015-06-26
      • 2012-04-28
      • 1970-01-01
      • 1970-01-01
      • 2014-06-24
      • 2016-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多