2

What is the difference between this two styles:

.style1 {
  flex-shrink: 0;
}

.style2 {
  flex-grow: 1;
}

If I'm setting the flex-grow to 1, it means that the element can't shrink, and vice-versa, right?

Thank you.

  • What? This isn't the same question! @LGSon --" –  Nov 05 '17 at 18:08
  • Added a second link and updated the first – Asons Nov 05 '17 at 18:09
  • Also, the question doesn't need to be the same, it is if an answer can answer both questions. – Asons Nov 05 '17 at 18:13
  • 1
    Simply put, `flex-grow` tells if to grow or not, where `flex-grow: 0` mean don't grow, and `flex-shrink` tells if to shrink or not, where `flex-shrink: 0` mean don't shrink. – Asons Nov 05 '17 at 18:29

1 Answers1

-1

setting ‘flex-grow: 1’ is default value which will allow an element to increase width evenly.

Setting ‘flex-shrink: 0 ‘ means that element width can be reduced if other siblings have greater width.

Good read on: https://css-tricks.com/snippets/css/a-guide-to-flexbox/