Compact arrangement of DIVs in two directions

后端 未结 5 2310
陌清茗
陌清茗 2020-12-16 22:50

It is easy to arrange DIVs horizontally with float. For example:

5条回答
  •  天命终不由人
    2020-12-16 23:08

    For arrange divs vertically you may use jquery plugin masonry

    It has effect like this:
    work of jquery.masonry

    This plugin is very easy to use:

        $(function(){
          $('#container').masonry({
            // options
            itemSelector : '.item',
          });
        });
    

    and this live demo showed how it work in your example

提交回复
热议问题