css - 处理 cols 和 bootstrap 网格

标签 css twitter-bootstrap

目前我在页面上有 col-sm-5col-sm-7 网格,如下所示

<section class="site-content site-section">
    <div class="container">
        <div class="row">
            <div class="col-sm-5 site-block">
                <table class="table table-bordered">
                    <tbody>
                        <tr>
                            <td><strong>test</strong></td>
                            <td class="text-right">test</td>
                        </tr>
                        <tr>
                            <td><strong>test</strong></td>
                            <td class="text-right">test</td>
                        </tr>   
                        <tr>
                            <td><strong>test:</strong></td>
                            <td class="text-right">test</td>
                        </tr>
                        <tr>
                            <td><strong>test:</strong></td>
                            <td class="text-right">test</td>
                        </tr>       
                    </tbody>
                </table>
            </div>
            <div class="col-sm-7 site-block">
                <h3 class="site-heading">
                    <p><strong>test </strong></p>
                </h3>
                <p><hr></p>                                     
                <p><strong>test</strong></p>
                    <div class="row">
                        <div class="col-sm-4">
                            <h3>test1</h3>
                               <hr>
                                 <p><a href="#" class="btn btn-info btn-warning"><span class="glyphicon glyphicon-file"></span> test</a></p>
                        </div>
                        <div class="col-sm-4">
                            <h3>test2</h3> <hr>
                                 <p><a href="#" class="btn btn-info btn-warning"><span class="glyphicon glyphicon-file"></span> test</a></p>
                        </div>
                        <div class="col-sm-4">
                            <h3>test3</h3>
                            <hr>
                              <p><a href="#" class="btn btn-info"><span class="glyphicon glyphicon-file"></span> test </a></p>
                        </div>
                    </div>                                                  
            </div>
        </div>
    </div>
</section>

为了更好地理解是什么产生了这个网格,这里是 JSFIDDLE所以现在我想将 col-sm-4 移动到 `col-sm-7 中 site-heading 的右侧。目前还不清楚我想要什么,所以这是它的形象: enter image description here

最佳答案

请检查这个,看看是否是您需要的。我已将主网格更改为 col-sm-4col-sm-8,然后在里面添加了一些。

<section class="site-content site-section">
    <div class="container">
        <div class="row">
            <div class="col-sm-4 site-block">
                <table class="table table-bordered">
                    <tbody>
                        <tr>
                            <td><strong>test</strong></td>
                            <td class="text-right">test</td>
                        </tr>
                        <tr>
                            <td><strong>test</strong></td>
                            <td class="text-right">test</td>
                        </tr>   
                        <tr>
                            <td><strong>test:</strong></td>
                            <td class="text-right">test</td>
                        </tr>
                        <tr>
                            <td><strong>test:</strong></td>
                            <td class="text-right">test</td>
                        </tr>                             
                    </tbody>
                </table>
            </div>
            <div class="col-sm-8 site-block">
                <div class="row">
                    <div class="col-sm-6">
                        <h3 class="site-heading">
                            <p><strong>test</strong></p></h3>
                            <p><hr></p>
                            <p><strong>test</strong></p>
                     </div>
                     <div class="col-sm-4">
                        <h3>test</h3>
                        <hr>
                        <p><a href="#" class="btn btn-info btn-warning"><span class="glyphicon glyphicon-file"></span> test</a></p>
                        <h3>test</h3> <hr>
                        <p><a href="#" class="btn btn-info btn-warning"><span class="glyphicon glyphicon-file"></span> test</a></p>
                     </div>                                             
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <h3>test</h3>
                    <hr>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="well">6</div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">7</div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">8</div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">8</div>
                        </div>    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</section>

DEMO JSFIDDLE

关于css - 处理 cols 和 bootstrap 网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36664949/

相关文章:

css - ADF 应用程序 CSS 问题

html - 响应式 Wordpress 表格问题

javascript - 如何根据用户输入和算法更改背景颜色

javascript - 使用 javascript 在 Bootstrap 面板中阅读更多内容

jquery - Bootstrapcollapse的hide方法会显示collapse元素

jquery - 如何使用包装 div 更改不透明度为 1 的内部 div 的颜色

html - 每个 div 显示两个内联图像并调整大小

html - 使用 Bootstrap 定位元素

javascript - 为 Bootstrap 重新创建 Aero Glass

html - Bootstrap 日期选择器显示