Answers for "css add space between flex items"

CSS
2

add space between all html elements flex

/* There is now a `gap` CSS property
** This works for <flex>, <grid>, and <multicolumn> layouts
** #box{} would lay out all it's children with 10px spacing between 
** different rows and 20px betwen different columns
*/
#box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px; /* row-gap [column-gap]*/
}

/* Supported by most modern browesers, Safari excluded. */
Posted by: Guest on January-14-2021
2

css flex gap between items

/* limited support (Q1/2021: Firefox, Chrome, Safari) */
.flex-container
{
  display: flex;
  gap: 5px;
}

/* broad support */
.flex-item
{
  margin: 5px;
  /* and/or */
  padding: 5px;
}
Posted by: Guest on February-25-2021
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

Code answers related to "css add space between flex items"

Browse Popular Code Answers by Language