Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
Why should I use .parent:hover .child:hover for it to work, when I colorize childs with odd and even order?

I'm making a chess board in HTML and CSS, I don't have problem making it, but there's a question :)

By attending to the code, I have a "board" class that is the parents of my "row" classes and rows are parents of my "cell" classes.

.board{
    width: 600px;
    height: 600px;
    margin:70px auto;
}

.board .row{float: left;}

.board .row .cell{
    width: 75px;
    height: 75px;
    float: left;
}

.board .row:nth-child(odd) .cell:nth-child(odd){background-color: white;}
.board .row:nth-child(even) .cell:nth-child(even){background-color: white;}
.board .row:nth-child(odd) .cell:nth-child(even){background-color: #222;}
.board .row:nth-child(even) .cell:nth-child(odd){background-color: #222;}

.board .row:hover .cell:hover {background-color: rgb(118, 194, 204);}

So, when I use .board .row .cell:hover {background-color:color;} It doesn't work.

But When I use the code written in the code above it works.

Why the first one doesn't work ? I think the problem is that I colorize my cells with odd and even order, because when I coloize them in other ways it works with the first one, but I what to colorize my cells with the way I did.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda