I would like to target flex items (random number of items) which are wrapped so I can remove the borders from the last non-wrapped item in each row or from the first wrapped item in each row. I would like to use a CSS pseudo-selector such as something I made up like "last-flexitem-in-row" so that the right border in this case would not appear. I know I can use JS to do this but it seems suboptimal and very heavy-handed to have to do it this way. Imagine as the container width shrinks during a browser resize, the amount of calculation would be crazy.
Any ideas?
.flexcontainer {
display: flex;
flex-wrap: wrap;
}
.flexcontainer li {
border-right: 3px solid #c00;
list-style: none;
flex: 0 0 100px;
padding: 10px;
}
.flexcontainer li:last-item-in-row {
border-right: none;
}
<ul class="flexcontainer">
<li>Item One</li>
<li>Item Two</li>
<li>Item Three</li>
<li>Item Four</li>
<li>Item Five</li>
<li>Item Six</li>
<li>Item Seven</li>
<li>Item Eight</li>
<li>Item Nine</li>
</ul>