Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1307

4 items per row but with empty space if there is less than 4 items?

$
0
0

I want to know if there is a way to have 4 items per row but not have the rows with <4 items to stretch to fill the space.

.item-container {  display: inline-flex;  flex-wrap: wrap;  flex-direction: row;}.item {  display: flex;  flex: 1 0 calc(25% - 40px);  color: black;  background-color: rgba(250, 250, 210);  flex-direction: column;  padding: 10px;  margin: 10px;  border-radius: 20px;}/* If there are 4 items it works well, but if there is 1-3 items they stretch to fill the space and look off. */

Viewing all articles
Browse latest Browse all 1307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>