<div id="container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
</div>
#container {
width: 200px;
height: 200px;
display: flex;
border: 2px solid purple;
flex-direction: row;
flex-wrap: wrap;
align-content: stretch;
}
#container div {
width: 40px;
height: 40px;
line-height: 40px;
padding: 4px;
text-align: center;
font-size: 20px;
background: greenyellow;
background-clip: content-box;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.