Width ignored on flexbox items

后端 未结 8 1585
有刺的猬
有刺的猬 2021-01-30 02:42

http://jsfiddle.net/XW9Se/

I\'ve set width: 200px; on the left

but if I view it with the browser inspector tool it appears that the
8条回答
  •  情话喂你
    2021-01-30 03:37

    My preferred way of dealing with this situation is to add:

    flex-shrink: 0;
    

    This way you may continue using width in your Flex container and you've given it specific information about how you wish this flex item to behave.

    Another option, depending on the requirement is to use min-width, which is respected when using flex.

提交回复
热议问题