css - How to set flex-basis on secondary axis -


how make flex item shrink in secondary axis?

for example, have container has lots of items inside. positioned in column, want width can shrinked:

.container {   display: flex;   flex-direction: column;   .item {     width: 200px;     flex: 0 1 @item-height;     //flex-shrink here means y-axis. how set flex-shrink x-axis??   } } 

you can use width: 100%; max-width: 200px; on .item. should cause items shrink width of parent element when it's below 200px. otherwise items stay @ 200px width.

works @ least long don't use flex-wrap.


Comments