flex-box box-sizing: border-box not working [duplicate]
问题 This question already has answers here : Why does box-sizing: border-box still show the border with a width of 0px? (2 answers) Closed 2 years ago . As title says: .cnr{ display: flex; height: 100%; background-color: grey; position: absolute; border: 1px red solid; } .cnr > div{ box-sizing: border-box; padding: 1em; border: 1em solid; overflow: hidden; } .cnr > .closed{ width: 0; flex-basis: 0; flex-shrink: 1; flex-grow: 0; min-width: 0; min-height: 0; } <div class="cnr"> <div> open </div>