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