Flexbox div doesn't take the whole width
问题 I'm trying to understand how display:flex works, but whenever I set it, the childs don't take the whole width. I was expecting the three divs getting a 33% of the screen width. What am I doing wrong? .flexbox { display: flex; } .flexbox div { border: 1px solid black; padding: 10px; } <div class="flexbox"> <div>One</div> <div>Two</div> <div>Three</div> </div> 回答1: You need to tell flex items to expand. They don't consume free space by default. The initial setting of flex-basis is auto , which