I've searched EVERYWHERE and can't find an answer for this.
How can I vertically and horizontally center a div in a masonry layout? I basically want everything to build around this div.
Any help would be great!
I've searched EVERYWHERE and can't find an answer for this.
How can I vertically and horizontally center a div in a masonry layout? I basically want everything to build around this div.
Any help would be great!
When you call masonry you can use the isFitWidth: true
and also then set margin: 0 auto on the container.
$container.masonry({
columnWidth : 120,
isFitWidth: true
});
See example live here : Centered Masonry
if it's just a div you could try to user
margin: 0 auto;
for the horizontal centering.
to center vertically you could try this:
http://blog.themeforest.net/tutorials/vertical-centering-with-css/