Html 引导容器周围的边界?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33761594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 18:30:48  来源:igfitidea点击:

Border around bootstrap container?

htmlcsstwitter-bootstrap

提问by Andrew

I have a container that contains two rows. I want there to be a border around the container (not between the two rows). When I tried to set a border around the container, it gave me a border between the two rows - not sure what I should be doing differently here.

我有一个包含两行的容器。我希望容器周围有一个边框(不在两行之间)。当我尝试在容器周围设置边框时,它给了我两行之间的边框 - 不确定我应该在这里做些什么不同的事情。

<div class="container-fluid" style="border:1px solid #cecece;"  
    <div class="row">                                           
      <!-- Need to add theme, buttons -->                       
      <div class="col-xs-12"> Text here </div>          
    </div>                                                      
    <div class="row">                                           
      <!-- Need to add theme, buttons -->                       
      <div class="col-xs-12"> Buttons here </div>               
    </div>                                                      
</div>                                                          

回答by Adam Lesniak

Your code is almostperfectly fine.

你的代码几乎完美无缺。

Look at first line of it - >is missing.

看看它的第一行 ->不见了。

See working example below.

请参阅下面的工作示例。

http://jsfiddle.net/864cw2fn/

http://jsfiddle.net/864cw2fn/

回答by curty005

<div class="container-fluid" style="border:1px solid #cecece;">  
    <div class="row">                                           
          <!-- Need to add theme, buttons -->                       
        <div class="col-xs-12"> Text here </div>          
    </div>                                                      
        <div class="row">                                           
          <!-- Need to add theme, buttons -->                       
        <div class="col-xs-12"> Buttons here </div>               
        </div>                                                      
    </div>