css grid column height fit content

49

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(min-content, max-content);
}
 /* ---OR--- */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: minmax(min-content, max-content);
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  grid-template-rows: repeat(2, auto) repeat(3, 1fr);
  grid-gap: 10px;
  height: calc(100vh - 10px);
}

Comments

Submit
0 Comments