1
Which property would be recommended for the content of the page not to be "leaked"? Which I used in the code above was not successful. I am trying to keep this pattern of 3 squares per column of Image 1.
var containerBoxElement = document.querySelector('#app')
containerBoxElement.style.maxHeight = '570px';
containerBoxElement.style.minWidth = '1103px';
containerBoxElement.style.position = 'fixed';
containerBoxElement.style.float = 'left'
Each click on the "Generate New" button a square is generated, in which the 4th is "leaked", where it should go to the next column.
btnCriar.onclick = function gerarQuadrado() {
var boxElement = document.createElement("div");
boxElement.setAttribute("class", "box");
boxElement.style.width = '180px';
boxElement.style.height = '180px';
boxElement.style.margin = '10px';
boxElement.style.backgroundColor = '#f00';
containerBoxElement.appendChild(boxElement);
}
Do you want this amount set according to the user’s browser? or would it always be 3 squares independent of the screen size? For example, if the screen can only draw 1 you want it to go to the next column?
– Leonardo Getulio
Yes, let it go to the next column and always 3 squares, regardless of the screen size.
– Gustavo Lopes
Then I used " maxheight = '570px'; "size for 3 squares (180px each) with the margin of 10px
– Gustavo Lopes