【问题标题】:How to add a border and background color to bootstrap row?如何为引导行添加边框和背景颜色?
【发布时间】:2019-07-06 05:49:25
【问题描述】:

我在我的项目中使用 Bootstrap Twitter(版本 3.1.1)。我正在处理的部分要求该行具有边框和背景颜色。我想知道添加这些 css 属性的最佳方法是什么。这是我的 HTML 结构的示例:

<div class="container" id="container_profile">
    <div id="section2" class="tab-pane fade">
        <div class="row">
             <div class="col-xs-6">Record ID: <strong>8734573</strong></div>
             <div class="col-xs-6">
                 <div class="pull-right">
                     <input type="checkbox" name="validated" value="yes" />
                 </div>
             </div>
        </div>
    </div>
</div>

我尝试添加另一个包含 col-xs-6 div 的内部 div。我使用了 div alert alert-warning 但这增加了一些奇怪的填充。向现有引导行添加样式的正确方法是什么?

【问题讨论】:

    标签: twitter-bootstrap twitter-bootstrap-3


    【解决方案1】:

    结构应该是:

    <div class="container" id="container_profile">
        <div id="section2" class="tab-pane fade">
         <div class="alert alert-warning">
            <div class="row">
                 <div class="col-xs-6">Record ID: <strong>8734573</strong></div>
                 <div class="col-xs-6">
                     <div class="pull-right">
                         <input type="checkbox" name="validated" value="yes" />
                     </div>
                 </div>
            </div>
          </div>
        </div>
    </div>
    

    【讨论】:

      猜你喜欢
      • 2015-07-13
      • 1970-01-01
      • 2013-03-09
      • 2013-03-27
      • 1970-01-01
      • 2015-04-21
      • 2012-07-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多