jquery - CSS div 换行和垂直空格

标签 jquery css html

当容器的宽度发生变化时,我试图让几个 div 元素换行到下一行。包装部分工作正常,当没有足够的宽度适合它时,盒子会掉到下一行,但是如果高度不同,第一行元素和第二行元素之间会有间隙。在下面的示例中,我希望框 b4 向上滑入 b1 下的空白区域。这可能吗?感谢您的帮助。

http://jsfiddle.net/86xcY/

最佳答案

    hello one small changes  i this case you must set the min-height and  max-height     details as follows. and when you add the content the height automatically increased.


   #box3 {
    display: table-cell;
    max-height: 300px;
    min-height: 98px;
    width: 200px;
 }

关于jquery - CSS div 换行和垂直空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12308018/

相关文章:

HTML/CSS : YouTube iframe as background with controls usable and button overlay

jquery - 如何阻止居中列表向右偏移

javascript - Bootstrap JS 在本地机器上不起作用

javascript - 从 100% 过渡到自动

循环内的Javascript点击功能

javascript - jQuery 的这些复选框的问题

javascript - 我希望我的代码创建由具有输入数量的行和列的 block 组成的网格

javascript - Bootstrap Modal 缩小动画

javascript - 如何为 HTML 5 map 绘制坐标

javascript - 如何将幻灯片移动到 HTML 页面的中心