css - How to Create Grid/Tile View? -


for example, have class .article, , want view class grid view. applied style:

.article{   width:100px;   height:100px;   background:#333;   float:left;   margin:5px; } 

that style make .article tiled/grid. it's work fine fixed height. if want set height auto (automatically stretch according data within it), grid nasty.

enter image description here

and want make view this:

enter image description here

this type of layout called masonry layout. masonry grid layout fill out whitespace caused difference height of elements.

jquery masonry 1 of jquery plugin create masonry layout.

alternatively, can use css3 columns. jquery based plugin best choice since there compatibility issue css3 column.


Comments

Popular posts from this blog

How to start daemon on android by adb -

testing - Detect whether test has failed within fixture -

Angularjs unit testing - ng-disabled not working when adding text to textarea -