Tiling divs with irregular sizes
From C++ to PHP, debugging to webhosting; help and discussion about writing your latest program to running your website. NOT for help when your PC won't work.
| Announcements | Posted on | |
|---|---|---|
-
Tiling divs with irregular sizes
http://puu.sh/B59Y
How would I go about tiling divs with irregular sizes so that they appear as above?Last edited by jordan.uni; 15-06-2012 at 18:01. -
Re: Tiling divs with irregular sizes
A javascript solution like http://masonry.desandro.com/ (a jQuery plugin) would be your best bet. What you're trying to do isn't possible without javascript or some sort of server side script dynamically generating the styles.
-
Re: Tiling divs with irregular sizesDang, got there first.(Original post by Rob801)
A javascript solution like http://masonry.desandro.com/ (a jQuery plugin) would be your best bet. What you're trying to do isn't possible without javascript or some sort of server side script dynamically generating the styles.
Adding to that, it would help if there's some regularity in your widths - they don't all have to be the same width, but preferably multiples of a reasonable number. That way, some can take up 1 column, some 2, etc. Have a look at the source here: http://masonry.desandro.com/demos/ba...ti-column.html
I used the single-column version as part of a tumblr theme, but it looks ugly atm. Pinterest also has a similar system, only they made it themselves.
You can just use CSS float, e.g. div{float:left}, but it leaves massive gaps. -
Re: Tiling divs with irregular sizesYeah, I'm trying to do this for a tumblr theme also.(Original post by cleverslacker)
Dang, got there first.
Adding to that, it would help if there's some regularity in your widths - they don't all have to be the same width, but preferably multiples of a reasonable number. That way, some can take up 1 column, some 2, etc. Have a look at the source here: http://masonry.desandro.com/demos/ba...ti-column.html
I used the single-column version as part of a tumblr theme, but it looks ugly atm. Pinterest also has a similar system, only they made it themselves.
You can just use CSS float, e.g. div{float:left}, but it leaves massive gaps.
