Skip to content Skip to sidebar Skip to footer

How To Keep Div From Shrinking, While Others Grow And Shrink In Flexbox

So I have one div with a set width of 225px(panel). The others are percentage based and use flexbox. The problem is the set width is decreasing in size as well. How would I avoid t

Solution 1:

To prevent shrinking you can use flex-shrink: 0, Info: MDN flex-shrink

.panel {
  height: 100%;
  width: 225px;
  background-color: white;
  border-right: 1px solid lightgrey;
  display: inline-block;
  position: relative;
  float: left;
  outline: solid red 1px
  flex-shrink: 0
}

Post a Comment for "How To Keep Div From Shrinking, While Others Grow And Shrink In Flexbox"