0
I’m having trouble putting together a chessboard, I left 4x4 just for the sake of aesthetics, someone could help me with the resolution of this?
casas = 4
for(i=0;i<casas;i++){
for(j=0;j<casas;j++){
tabuleiro.innerHTML += "<div></div>"
}
}
#tabuleiro{
width: 400px;
}
#tabuleiro div{
background-color: red;
width: 100px;
height: 100px;
float: left;
}
#tabuleiro div:nth-child(2n){
background-color: #b58763
}
#tabuleiro div:nth-child(2n+1){
background-color: #f0dab5
}
<div id='tabuleiro'></div>
What is the question exactly? At what point are you having difficulty?
– bfavaretto
CSS-only answers: https://answall.com/questions/319900/como-fazer-com-css-um-fundo-checker_tabular
– hugocsl