There is an example of layout. When the window is resized, everything, as it should be, for the <a> tags, the width changes and their number on the line changes.
But if the last line of <a> elements is less than in the previous lines, then these elements are stretched.
Is it possible to make so that in the last line the width of <a> matches the elements from the previous lines.
PS For clarity. Now, as in the red blocks, I would like as in the green 
PSS With the help of JS, I know how to do this, it is precisely CSS that interests me.
B.addEventListener("click", add); C.addEventListener("click", take); function add() { A.style.width = A.offsetWidth + 50 + "px"; } function take() { A.style.width = (A.offsetWidth - 50) + "px"; } .work { display: flex; min-width: 67.5em; max-width: 96em; min-height: 55em; /*-----*/ font-size: 4px; padding: 3.75em; background-color: hsla(0, 0%, 100%, 0.7); box-sizing: border-box; } .faculty { display: block; /*-----*/ background-color: #F0E68C; } .container_link { display: flex; flex-direction: row; flex-wrap: wrap; } a { min-width: 5em; flex: 1; display: block; /*-----*/ font-size: 2.25em; margin: 1.3em 0.5em 0; background-color: hsla(0, 0%, 90%, 1); text-decoration: none; border: 1px dashed #3B8686; padding: 0.83em; } <button id="B">+ Width khaki</button> <button id="C">- Width khaki</button> <div id="A" class="work"> <div class="faculty" id="GF"> <div class="container_link"> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a> </div> </div> </div>
max-widthequal to the width of the first link. But this is in my opinion quite a crutch. - Jarry Roxwell