I use css flexbox to place an unknown number of elements in rows, wrapping extra lines if necessary.
My question is: is it possible to have a horizontal line between each line?
Here is a simple example of what I have. If you open the encoder, you will see that the elements are wrapped in two lines (this can be more than two or only one - it depends on the exact number of elements and the width of the screen). I would like to have a horizontal line between the lines.
<div> <span>First item</span> <span>Second item</span> <span>Third item</span> <span>Fourth item</span> <span>Fifth item</span> <span>Sixth item</span> </div>
With the following CSS:
div { border: 1px solid black; width:20%; display: flex; flex-flow: row wrap; } span { border: 1px solid blue; margin: 5px; }
html css flexbox
Asher
source share