you can do this with flex. which should work
.container { display: flex; flex-wrap: wrap; gap: 0.5rem; } .element1, .element2 { flex: 1 1 11rem; }