如何在两列中浮动文章? [英] How do I float articles in two columns?

查看:167
本文介绍了如何在两列中浮动文章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题。我正在建立一个社交网站,我必须在两列中创建帖子。父容器是一个部分,而post元素是其样式为float:left的文章。如何让它滑到那些在较短的空间下创建的空白区域?

I have this problem. I am building a social website and I have to create posts in two columns. The parent container is a section, instead the elements "post" are articles that have as their style float: left. How do I let slip to the post of the empty space that creates under those shorter?

推荐答案

css还没有很好的解决方案。这通常被称为砖石或pinterest布局。
使用jquery。

there is no good solution in css yet. this is typically called a masonry or pinterest layout. use jquery.

尝试...
http://masonry.desandro.com/

或谷歌'砌体布局插件'

or google 'masonry layout plugin'

这篇关于如何在两列中浮动文章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆