Width ignored on flexbox items

后端 未结 8 1564
有刺的猬
有刺的猬 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:41

    The answer from Adrift is perfect; but a change to make it more flex would be

    #left{
        flex-basis: 200px;
        flex-grow: 0;
        flex-shrink: 0;
    }
    

    And remove the width property entirely.

    It would be the flex way to say that the element will have an invariable width of 200px

提交回复
热议问题