0

Front-end code:

                return (
                    <div className="card" key={i} >
                        <img src={anime["main_picture"]["medium"]} alt="Anime" className="cardImage"></img>
                        <div className="cardTitle">
                            <p>{anime["title"]}</p>
                        </div>
                    </div>
                );
            })}

CSS:

.card{
    height: 10vmin;
    flex-direction: row;
    display: flex;
    border-top : 1px solid #000;
    border-bottom : 1px solid #000;
    align-items: center;
}

.card :hover{
    background-color: #E3E3E3;
}

when Hovering over the card div, it changes the background color of its child items instead of the whole div. Any ideas as to what's wrong? Thank you

1 Answers1

0

There is a space between your selector and hover. It Should be .card:hover.

Jaspero
  • 2,912
  • 6
  • 26
  • 30