I am trying to have a flexbox, and some elements inside. I try to set the width of the elements inside the width box, for example to 500px for each one, but they are limited in width and they don't take the required width.
Below is my code:
#container{
display: inline-flex;
border: 5px solid ;
width: 20%;
flex-wrap:
}
.first{
background-color: red;
width: 300px;
}
.second{
background-color: green;
width: 400px;
}
.third{
background-color: yellow;
width: 400px
}
<div id="container">
<div class="first">
<span>first item</span>
<h1> 01 </h1>
</div>
<div class="second">
<span>second item</span>
<h1> 02 </h1>
</div>
<div class="third">
<span>third item</span>
<h1> 03 </h1>
</div>
<div class="first">
<span>first item</span>
<h1> 01 </h1>
</div>
<div class="second">
<span>second item</span>
<h1> 02 </h1>
</div>
<div class="third">
<span>third item</span>
<h1> 03 </h1>
</div>
<div class="first">
<span>first item</span>
<h1> 01 </h1>
</div>
<div class="second">
<span>second item</span>
<h1> 02 </h1>
</div>
<div class="third">
<span>third item</span>
<h1> 03 </h1>
</div>
</div>
As can be seen, the elements take around 400px for the width as specified in css, but in the html generated, they don't. Is there something wrong I am doing?