添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

All bootstrap grids works as your second example. .row element have a negative margin to compensate the positive padding in the .col-* elements. So it´s better and more logical your second example.

In the first example, you haven't got the paddings of the .col-* elements and the negative margin will produce unexpected results.

Example with col-sm-12 :

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="row">
    <div class="col-sm-12">
        <h1>title</h1>
    <div class="col-sm-6">
    <div class="col-sm-6">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="row">
    <h1>title</h1>
    <div class="col-md-6">
    <div class="col-md-6">
                External bootstrap library throws a Permission Denied error, but you can test it in your localhost. I will try to fix this error in the snippet, but the problem is clear. :)
– Marcos Pérez Gude
                May 9, 2016 at 8:42
                Yea, I know it works - upvoted already :) however, I'm not getting any network error in the console (chrome v50), so I thought that maybe in v3.3.6 they changed something in the grid. Tnx for the update :)
– Vucko
                May 9, 2016 at 8:47
                It's possible, I don't know why this doesn't works. LOL. I edited without protocol because it throws errors, but now doesn't throws errors but still doesn't works. However, all people can test it in a boostrap fiddle like this: bootply.com
– Marcos Pérez Gude
                May 9, 2016 at 8:55
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.