Why is an element with width:100% not taking the parent's width?
问题 I am facing the issue that I cannot set the same width as its parent inside a flexbox item. Here is the code and the span with the class theSpan doesn't have the same width as its parent. .container { display: flex; } .item1 { flex: 1 1 200px; border: 5px solid yellow; } .item2 { flex: 1 1 200px; border: 5px solid blue; } .item3 { flex: 1 1 200px; border: 5px solid red; } .theSpan { width: 100%; border: 2px solid black; } <div class='container'> <div class='item1'> <span class='theSpan'