How can I identify the last element of the first row and the first element of the last row in the given code to make it round from all corners? It should be noted that the column number will vary as well as the last element of the first row and first element of the last row according to the screen size.
.container {
display: flex;
flex-wrap: wrap;
}
.container > span {
flex: auto;
padding: 5px;
background: gray;
border: 1px solid;
}
.container > span:first-child {
border-top-left-radius:10px;
}
.container > span:last-child {
border-bottom-right-radius:10px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<span>The</span>
<span>Quick</span>
<span>Brown</span>
<span>Fox</span>
<span>Jumped</span>
<span>Over</span>
<span>The</span>
<span>Lazy</span>
<span>Dog</span>
<span>This</span>
<span>Is</span>
<span>A</span>
<span>Test</span>
<span>Case</span>
<span>What</span>
<span>Can</span>
<span>I</span>
<span>Do</span>
<span>The</span>
<span>Earth</span>
<span>Goes</span>
<span>Round</span>
<span>The</span>
<span>Sun</span>
</div>