Код: Выделить всё
const cdiv = document.querySelector('.container');
// Add 16 divs
for (let i = 1; i < 257; i++) {
const div = document.createElement('div');
div.style.cssText = "border: 1px solid black; height: 25px; width: 25px";
cdiv.appendChild(div);
}Код: Выделить всё
* {
box-sizing: border-box;
}
.container {
display: flex;
flex-wrap: wrap;
}
.container>div:nth-child((16n + 1)) {
width: 100% !important;
}Код: Выделить всё
Etch-a-Sketch
Подробнее здесь: https://stackoverflow.com/questions/699 ... 100-wont-w