dqroc48068 2013-02-14 10:13
浏览 36
已采纳

如何重新排序内联块元素列表以填充所有空白区域?

I need to reorder a list of elements with the attribute display: inline-block and with not defined width for fill all empty space.

You can understand what I mean with this example:

http://jsbin.com/ozuxip/1/edit

As you can see, in the first list, near "Not so long text" there is lot of white space, and in the second list that space is filled with two elements enough short for fill the space. I need to automatize it.

In this example you can see with a red rectangle what is the "white space" http://jsbin.com/ozuxip/7/edit

I can use PHP, jQuery, CSS etc. Do you have some advice?

  • 写回答

2条回答 默认 最新

  • dqv84329 2013-02-15 22:06
    关注

    If I understood your question properly, you basically want elements of different widths to create some kind of neat grid. If so, you could try using Isotope plugin: http://isotope.metafizzy.co/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 什么设备可以研究OFDM的60GHz毫米波信道模型
  • ¥15 不知道是该怎么引用多个函数片段
  • ¥15 pip install后修改模块路径,import失败,需要在哪里修改环境变量?
  • ¥15 爬取1-112页所有帖子的标题但是12页后要登录后才能 我使用selenium模拟登录 账号密码输入后 会报错 不知道怎么弄了
  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决