I would like to add list of images (using figure
and figcaption
) in rows which should be responsive.
figcaption
should have the same with as the figure
.
I was trying this, but it works only when all figcaption
have the same height; if not, the result is a mess (change the browser width to see the issue):
figure { display: table; float: left; }
figcaption { display: table-caption; caption-side: bottom ; }
I also did this that works good on Firefox, but Chrome doesn't see style width: 100%
of figcaption.
figure {
display: inline-block;
vertical-align: top;
}
img, figcaption {
vertical-align: bottom;
}
figcaption {
width: 100%;
display: table-caption;
background: #f55544;
}
Please help - I must finish this but I don't have any more ideas to resolve this problem.
This solution uses JavaScript, there may be another solution using only CSS and
flex
displays but I don't know it right now. It would consist on finding the highest figure, and then setting that height to the rest of the figures like this.It would be like this:
And you can see it also on this JSFiddle: http://jsfiddle.net/tm4tjp4c/8/