I am trying to the get my head around this for quite some time now:
Is it possible to create a pinterest Layout with Twitter Bootstrap only? I know there are jQuery Plugins like Masonry, but is there no way without them?
Thanks
I am trying to the get my head around this for quite some time now:
Is it possible to create a pinterest Layout with Twitter Bootstrap only? I know there are jQuery Plugins like Masonry, but is there no way without them?
Thanks
Yes, it is possible but with some limitations.
Principle
div
(orsection
depending upon the meaning of your layout)div
, orimg
etc. depending upon your design.Practice
To make the columns you can use the following various techniques:
float
the columnsdisplay: inline-block
the columnsThen place various tiles (
div
s) in each column. Again, depending upon your design/layout you could replace the column-divs withul
s, and have a list of tiles (li
s). I can't speak as to whether that is semantically correct for your design.Limitations
Work-Arounds
With some time, one could get pretty close to the Pinterest layout - that said, there's probably a good reason they chose to implement said layout with JavaScript.
I know my answer is late. but just wanted this common question to be up dated. I found out 3 latest implementations.
EDIT: This is now out of the box in boostrap 4 http://v4-alpha.getbootstrap.com/components/card/#card-columns
Sure Thing. Took me a while to work out. Hope this helps!
Apologies for the code dump but its necessary to show the grid working.
Found a (free) template at http://bragthemes.com/demo/pinstrap/. It's supposed to have all you are asking for. Haven't had time to check it out, though.
Edit 2016-03-15: Bootstrap 4 allows this out of the box here. It's still in alpha, but we're getting there.
For everyone who dont want want to go through the hassle of cross browser compatibility, here is a PHP solution. Assuming you have your data in an array,