I'm currently doing a redesign of a portfolio section for a website, and the idea is to have a representative image for each client that serves as a background of a link block, and when you mouse over the image, a semi-transparent overlay with some brief text summary eases in. This block can be clicked on to take the user to an individual page that describes the client and its work in more detail. The portfolio section is in flex-box display for easy responsiveness.
Here's an abridged version of what I've got: https://jsfiddle.net/ddw2m9ea/
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
font-family: Open Sans;
}
.row {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
figure {
overflow: hidden;
flex: 1 0 0px;
position: relative;
margin: 0;
height:240px;
}
figure > img {
width:100%;
}
a > img {
max-width: 100%;
vertical-align: middle;
}
I've tried applying the vertical-align: middle;
to a few things that have had no effect, and currently you see that the image continues to flow further and further down, out of the container, as it gets larger. I need a solution that will vertically center the images without changing their dimensions.