使用twitter bootstrap根据邻居列的高度设置div的最小高度

时间:2014-03-07 10:40:30

标签: html css twitter-bootstrap

所以我正在努力建立自己的论坛,我决定从推特开始,让自己开始。在左栏中是海报信息,如海报的用户名,发布日期以及适用时编辑,删除等控件。右栏是发布的消息。问题是如果消息真的很短,那么帖子看起来很奇怪,如下图所示:

--------------------
|     |            |
|     |            |
|     |-------------
|     |
-------

我想将消息列的最小高度设置为海报信息列的高度,以便对于短消息,布局看起来更像:

--------------------
|     |            |
|     |            |
|     |            |
|     |            |
--------------------

这是我的代码片段:

HTML:

<div class="row slight-margin-vert">
  <div class="col-md-3">
    <div class="slight-margin-vert">
      <p><strong>Username</strong></p>
      <p><strong>Posted:</strong> 10 minutes ago </p>
    </div>
  </div>
  <div class="col-md-9">
    <div class="background-white rounded">
      <p>lorem ipsum</p>
    </div>
  </div>
</div>

的CSS:

.background-white {
  background-color: #ffffff;
  padding: 15px;
}
.rounded {
  border-radius: 15px;
}
.slight-margin-vert {
  margin-top: 15px;
  margin-bottom: 15px;
}

0 个答案:

没有答案