I am trying to create something like this:
At the moment I have created this:
* {
margin: 0px;
padding: 0px;
font-family: "Roboto";
}
.wrapper {
width: 100%;
max-width: 1000px;
margin: 0px auto;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
.article {
margin: 10px;
padding: 10px;
background-color: orange;
flex-basis: 200px;
flex-grow: 1;
}
.productImg {
display: block;
height: 100%;
width: 100%;
}
<div class="wrapper">
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
<div class="article">
<img class="productImg" src="https://static.pexels.com/photos/3847/jetty-landing-stage-sea-sky.jpeg" />
</div>
</div>
Everything works well, but the last .article
is sometimes to big. The size should be the same as the .article
above him. How can I do this?
I've tried it with max- and min-width, but this didn't worked well.