Answers for "how to give equal space to all elements in flexbox"

CSS
0

add space between flex items

.flex-gap {
  display: inline-flex;
  flex-wrap: wrap;
}

.flex-gap > div {
  margin: 6px; /* HERE WE ADD THE SPACE */
}
Posted by: Guest on June-15-2020
2

gap between two flex items

.upper
{
  margin:30px;
  display:flex;
  flex-direction:row;
  width:300px;
  height:80px;
  border:1px red solid;

  padding:5px; /* this */
}

.upper > div
{
  flex:1 1 auto;
  border:1px red solid;
  text-align:center;

  margin:5px;  /* and that, will result in a 10px gap */
}

.upper.mc /* multicol test */
{flex-direction:column;flex-wrap:wrap;width:200px;height:200px;}
Posted by: Guest on June-01-2020

Code answers related to "how to give equal space to all elements in flexbox"

Browse Popular Code Answers by Language