有人能解决我遇到的问题吗? 如果列表元素应该在每个元素底部没有空格的情况下相互附加,那就太好了。实际上,新行是行的高度,它是最大元素的高度。我希望你明白我的意思。 抱歉我的英语不好!
请参阅图片以更好地理解。
最佳答案
我不认为有一个纯 css 的答案,它真的取决于你想要差距的地方。这是您可以使用 jQuery 执行的操作。
var heightest = 0;
$('li').each(function() {
var thisHeight = $(this).height();
if(thisHeight > heightest){
heightest = thisHeight
}
})
// got the heightest height.
$('li').height(heightest);
关于css - (CSS) 列表元素 : floating left but append to each other without spacing bottom?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28996382/