如何使用boostrap动态调整面板位置

时间:2016-01-18 08:20:27

标签: html css

我正在尝试做某种“facebook thingy”,事情是我正在制作一些彼此并排的面板(连续3个),我正在尝试做类似的事情谷歌保留笔记,他们调整大小:

http://cdn.mos.techradar.com/art/other/Onetimers/Google%20Keep%20for%20mobile-970-80.jpg

我找到了一个模板,我认为可以做到这一点,但是当使用它并修改它时我会遇到一个问题,面板表现得很奇怪,一些面板调整而不是其他面板,这里是一个实际的例子:

http://postimg.org/image/pqk735jfv/

我不知道如何实现这一目标,因为我是Css世界的新手,所以我有点失落,所以如果有人可以指导我那将会很棒。

这是我的HTML代码:

<div class="container" id="post">
<div class="row">
    <div class="col-lg-12">
         <div class="well"> 
         <form class="form-horizontal" role="form">
          <h4>Title</h4>
           <div class="form-group" style="padding:14px;">
            <textarea class="form-control" placeholder="....."></textarea>
          </div>
          <button class="btn btn-success pull-right" type="button">Post</button>
          <ul class="list-inline">
          <li><a href="#"><i class="glyphicon glyphicon-picture"></i></a></li>
          </ul>
        </form>
    </div>
    </div>
</div>
</div>


<!--main-->
<div class="container" id="main">
<div class="row">
<div class="col-lg-12 col-md-4 col-sm-6">

   <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        </div>

       <div class="panel-body"><img src="http://placehold.it/400x500" alt="" class="img-responsive center-block" />
                </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div>

    <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        </div>

       <div class="panel-body"><img src="http://placehold.it/400x500" alt="" class="img-responsive center-block" />
                </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div>

    <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam. 
        </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div>

   <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        </div>

       <div class="panel-body"><img src="http://placehold.it/400x500" alt="" class="img-responsive center-block" />
                </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div>

    <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        </div>

       <div class="panel-body"><img src="http://placehold.it/400x500" alt="" class="img-responsive center-block" />
                </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div>

    <div class="col-lg-4">
    <div id="idk" class="panel panel-default">

      <div class="panel-heading"> 
      <a href="#"><i class="glyphicon glyphicon-cog"></i></a> 
      <a class="thumbnail pull-left" href="#">
      <img class="media-object" src="//placehold.it/80">
       </a>
      <h4 id="textpost">Edgar Luna</h4>
      <p id="textdown">2 hrs.</p>
      </div> 

        <div class="panel-body">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        </div>

       <div class="panel-body"><img src="http://placehold.it/400x500" alt="" class="img-responsive center-block" />
                </div>

          <form>
          <div id="btns" class="input-group">
            <div class="input-group-btn">
            <button class="btn btn-default">+1</button><button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i></button>
            </div>

          </div>
          </form>

    </div>
  </div> 
</div>  
  </div><!--/row-->
 </div><!--/main-->

CSS(我没有碰到这个,因为正如我之前所说,我不知道很多,只是基本的东西):

@import url(http://fonts.googleapis.com/css?family=Roboto:400);
body {
background-color:#e0e0e0;
-webkit-font-smoothing: antialiased;
font: normal 14px Roboto,arial,sans-serif;
}
.navbar-default {background-color:#f4f4f4;margin-top:50px;border-width:0;z-index:5;}
.navbar-default .navbar-nav > .active > a,.navbar-default .navbar-nav > li:hover > a {border:0 solid #4285f4;border-bottom-width:2px;font-weight:800;background-color:transparent;}
.navbar-default .dropdown-menu {background-color:#ffffff;}
.navbar-default .dropdown-menu li > a {padding-left:30px;}

.header {background-color:#ffffff;border-width:0;}
.header .navbar-collapse {background-color:#ffffff;}
.btn,.form-control,.panel,.list-group,.well {border-radius:1px;box-shadow:0 0 0;}
.form-control {border-color:#d7d7d7;}
.btn-primary {border-color:transparent;}
.btn-primary,.label-primary,.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus {background-color:#4285f4;}
.btn-plus {background-color:#ffffff;border-width:1px;border-color:#dddddd;box-shadow:1px 1px 0 #999999;border-radius:3px;color:#666666;text-shadow:0 0 1px #bbbbbb;}
.well,.panel {border-color:#d2d2d2;box-shadow:0 1px 0 #cfcfcf;border-radius:3px;}
.btn-success,.label-success,.progress-bar-success{background-color:#65b045;}
.btn-info,.label-info,.progress-bar-info{background-color:#a0c3ff;border-color:#a0c3ff;}
.btn-danger,.label-danger,.progress-bar-danger{background-color:#dd4b39;}
.btn-warning,.label-warning,.progress-bar-warning{background-color:#f4b400;color:#444444;}

hr {border-color:#ececec;}
button {
outline: 0;
}
textarea {
resize: none;
outline: 0; 
}
.panel .btn i,.btn span{
 color:#666666;
}
.panel .panel-heading {
 background-color:#ffffff;
 font-weight:700;
 font-size:16px;
 color:#262626;
 border-color:#ffffff;
}
.panel .panel-heading a {
 font-weight:400;
 font-size:11px;
}
.panel .panel-default {
 border-color:#cccccc;
}
.panel .panel-thumbnail {
 padding:0;
}
 .panel .img-circle {
 width:50px;
 height:50px;
}
.list-group-item:first-child,.list-group-item:last-child {
 border-radius:0;
}
h3,h4,h5 { 
border:0 solid #efefef; 
border-bottom-width:1px;
padding-bottom:10px;
}
.modal-dialog {
 width: 450px;
}
.modal-footer {
border-width:0;
}
.dropdown-menu {
 background-color:#f4f4f4;
 border-color:#f0f0f0;
 border-radius:0;
 margin-top:-1px;
 }



#subnav {
position:fixed;
width:100%;
}

@media (max-width: 768px) {
#subnav {
 padding-top: 6px;
 }
}

#main {
 padding-top:25px;
}

0 个答案:

没有答案