Quantcast
Viewing all articles
Browse latest Browse all 1318

How can I set a minimum amount of space between flexbox items?

Given this CSS:

div.container {  display: flex;  flex-flow: row wrap;  justify-content: space-between;  border: 1px solid blue;}div.container div {  width: 200px;  border: 1px solid gray;  display: inline-block;  text-align: center;}

This layout has the first item in each row aligned to the left, and the last item aligned to the right, as required.

As the browser window is made narrower, the distributed div elements will move closer together until they touch, at which point they are re-arranged over an additional row. Again, the first div on each row is aligned left, and the last aligned right with space between.

Is there any way of setting a minimum spacing so that the inner div elements always have a gap between them.

padding and margin will probably not work, as the alignment

<-- 1st left in row and last right in row --> will not hold.


Viewing all articles
Browse latest Browse all 1318

Trending Articles



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