Here is the code I am working with:
<div id="parent">
<div class="produit_sup">
<p>Aubergine</p>
<p>Betterave</p>
<p>Courgette</p>
<p>Oignon</p>
<p>Poireau</p>
<p>Pomme de terre</p>
<p>Tomate</p>
</div>
</div>
<style>
#parent{
display: flex;
}
.produit_sup{
max-height: 100px;
background: #c3c3ff;
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.produit_sup>p{
width: 100px;
text-align: left;
margin: 0 20px 0 0;
}
</style>
I am wondering why the layout looks like this:
https://i.sstatic.net/3yPFO.png
Instead of looking like this:
https://i.sstatic.net/7jVXo.png
I would like to maintain the display:flex;
property of the parent element, and the number of <p>
items may vary over time.