如何复制 pinterest.com 的绝对 div 堆叠布局 [英] how to replicate pinterest.com's absolute div stacking layout

查看:25
本文介绍了如何复制 pinterest.com 的绝对 div 堆叠布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望复制 Pinterest.com 的 div 布局,特别是如何调整列数以适应浏览器调整大小的更多/更少,并且垂直堆叠不依赖于相邻的列高度.源代码显示每个 div 都是绝对位置.一位联合创始人回答了 Quora 的帖子,称它是使用自定义 jQuery 和 CSS 完成的.我希望结果从左到右排序.您可以提供任何指导以自己制作,我们将不胜感激.

I am looking to replicate Pinterest.com's div layout, specifically how the number of columns adjusts to fit more/less on browser resize and the vertical stacking is not dependent on adjacent column heights. The source code shows that each div is position absolute. A co-founder has answered a Quora post stating it is done with custom jQuery and CSS. I would like the results sorted left to right. Any direction you could provide to make it myself would be greatly appreciated.

推荐答案

您也可以查看 jQuery 插件 Masonry,对于这种功能.

You could also check on the jQuery Plug-in Masonry, for this kind of functionality.

这篇关于如何复制 pinterest.com 的绝对 div 堆叠布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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