While working on an auto-fill grid that moves elements to the next line when the width reaches 800px, I encountered an issue with my text inside the grid not stretching.
https://i.sstatic.net/OeJ3I.png
Below is my CSS code:
ul {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
grid-template-rows: auto;
justify-content: center;
align-items: center;
text-align: center;
li {
margin: 0 10px;
list-style-type: none;
cursor: pointer;
border: 1px solid black;
border-radius: 10px;
adding: 5px;
}
}
After making some updates:
I discovered that using auto-fit could partially solve my problem,
yet, I am interested in having only [New one] and [Test two] stretch to fit one line. This way, these buttons can expand to multiple lines if there are too many of them.