如何让div自动填充可用空间

时间:2016-07-21 09:06:09

标签: jquery html css twitter-bootstrap

我有这个html页面:

jsFidlle Demo

我希望这些方框能够自动填充可用空间,方框宽度相同但高度不同。

就像google keep

中的注释一样

3 个答案:

答案 0 :(得分:1)

我希望它会对你有所帮助。

https://www.sitepoint.com/bootstrap-tabs-play-nice-with-masonry/

这与bootstrap兼容。

答案 1 :(得分:0)

你不能使用CSS。您必须使用jQuery Masanory

之类的内容

答案 2 :(得分:0)

似乎无法实现jsfiddle的效果,但这就是我要去做的事情

<div class="which-ever-class-name"> //surrounding the two divs
<div class="components">Help us find a visionary financier!</div>
<div class="components">Kamusi Here:<br>
Instant translation among the languages in our system (arriving soon at 50+)
<ul>
<li>Chrome extension: ready to ship (pending server)
<li>Mobile app: we need a day or three to join Here! and WordUp!
<li>Facebook Messenger: needs some easy hacks
<li>Other platforms: we've got the back end, just need the implementation horsepower
</ul>
</div>
</div>//end surrounding div

和css

.components{
  height:100%;
 }

这应该做的是将组件高度设置为填充父(which-ever-class-name)高度,而父高度依次设置为最长组件。

相关问题