2012-09-23 70 views
1

虚假问题的借口。 我需要使用twitter bootstrap创建3个流体列布局。 第一栏是页宽的45%, 第二栏是10% 第三栏应该是页宽的45%。twitter bootstrap流体布局3列

我已经试过这样:

<div class="container-fluid"> 
    <div class="row-fluid"> 
     <div class="span5"> 
      <table class="table table-bordered"> 
       <thead> 
       <tr> 
        <th>#</th> 
        <th>First Name</th> 
        <th>Last Name</th> 
        <th>Username</th> 
       </tr> 
       </thead> 
       <tbody> 
       <tr> 
        <td>2</td> 
        <td>Jacob</td> 
        <td>Thornton</td> 
        <td>@fat</td> 
       </tr> 
       <tr> 
        <td>3</td> 
        <td colspan="2">Larry the Bird</td> 
        <td>@twitter</td> 
       </tr> 
       </tbody> 
      </table> 
     </div> 
     <div class="span2"></div> 
     <div class="span5"> 
      <table class="table table-bordered"> 
       <thead> 
       <tr> 
        <th>#</th> 
        <th>First Name</th> 
        <th>Last Name</th> 
        <th>Username</th> 
       </tr> 
       </thead> 
       <tbody> 
       <tr> 
        <td>2</td> 
        <td>Jacob</td> 
        <td>Thornton</td> 
        <td>@fat</td> 
       </tr> 
       <tr> 
        <td>3</td> 
        <td colspan="2">Larry the Bird</td> 
        <td>@twitter</td> 
       </tr> 
       </tbody> 
      </table> 
     </div> 
    </div> 
</div> 

但中间一列是太宽,它不是屏幕宽度的10%。 请帮助我在twitter引导中获得流体布局的ide。

回答

2

在Twitter Bootstrap与12列流体布局span2width: 14.5299%span5width: 40.1709%

这是将介质宽度分成12列和其排水槽的结果。

如果你需要一个diferent分布,你可以在这里定制您的布局:http://twitter.github.com/bootstrap/customize.html

+0

我看过这个网页,但我不明白如何打破这些列45/10/45。我已经打开生成的bootstrap.css文件,并查看硬编码像素值.spanXX宽度 – Sergey

+0

固定布局和流体布局的百分比值有像素值。 – albertedevigo

+0

对不起,好像我很笨。 http://twitter.github.com/bootstrap/customize.html#components - 默认情况下在列宽度的变量中固定了px值。我必须输入45%而不是整数吗? – Sergey

0

如果你需要比,只是从12列改变BS网格系统20列。然后使用span9,span2,span9。

但是,这不会完全45/10/45百分比。由于BS有排水沟...