Make CSS Grid auto-fill only 2 columns
问题 I am using CSS Grid and have made the following layout in the codepen found here: https://codepen.io/alexg2195/pen/xLEeMd My issue is that when using repeat(auto-fill, minmax(400px, 1fr)); I end up with a layout that goes beyond just two columns. Is there a way to force two columns but still have the same min auto fill resize behaviors? body { margin: 40px; } .layout { display: grid; grid-gap: 10px; grid-template-columns: 1fr 100px; grid-template-areas: "main btn" "main ."; } .btn { grid-area