Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Build a responsive and animated grid with images of different sizes

Build a responsive and animated grid with images of different sizes

Problem

What I'm trying to achieve is a banner composed of many images, like this: http://imgur.com/I0NcWdy

The dimensions and aspect ratios of the images are different, but they appear on the same layout grid (so the HTML/CSS "skeleton" can be fixed), every image appears at different times with an animation effect (jqueryui's bounce).

The banner has no fixed dimensions, it scales proportionally based on the window's size mantaining it's aspect ratio. I've already managed to obtain a proportionally scaling DIV, so that's not a concern.

I'm trying hard to figure how to do it buy with no success, tried Masonry but I cannot animate or place the images like I want. Any suggestions?

Problem courtesy of: Cranio

Solution

Would this work for you?

Apply a custom class to size and possibly position each image, for example, either something as simple as:

CSS

.image1{
width:10%;
height:auto;
}

.image2{
width:20%;
height:auto;
}  

or possibly:

.image1{
position:relative;
top:0;
left:0;
width:10%;
height:auto;
}  

.image2{
position:relative;
top:0;
left:10%;
width:20%;
height:auto;
}   

.image3{
position:relative;
top:0;
left:30%;
width:15%;
height:auto;
}   

HTML

....

Naturually you would need to play with the positioning and sizing depending on the specifics and relative ratios of your images. If this is feasable though it would scale well and work with any animation you have.

Good luck!

Solution courtesy of: David Taiaroa

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Build a responsive and animated grid with images of different sizes

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×