I have multiple items with same width inside a container. Because of different heights of the elements, there is problem with the alignment, you can see in image below.
You can use:
.list {
display:flex;
flex-wrap: wrap;
...
}
See below:
.list {
width: 300px;
overflow: hidden;
display: flex;
flex-wrap: wrap;
}
.item {
float: left;
width: 90px;
background: yellow;
margin-right: 5px;
margin-bottom: 10px;
}
.item:nth-child(3) {
background: brown;
}
.item:nth-child(3):after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
Lorem ipsum dolor sit amet,
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet,
Lorem ipsum dolor sit amet,
Lorem ipsum dolor sit amet