Answers for "gap within flex container"

CSS
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
1

gap css flex

/* elements in a row */
	.row-flex-container {
      display: flex;
      flex-direction: row;
      column-gap: 2rem;
    }

	/* elements in a column */
    .column-flex-container {
      display: flex;
      flex-direction: column;
      row-gap: 2rem;
    }
Posted by: Guest on April-21-2022

Browse Popular Code Answers by Language