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.
and want make view this:
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 column
s. jquery based plugin best choice since there compatibility issue css3 column.
Comments
Post a Comment