Currently, I am working on the front-end using the NextJS framework. When a user clicks a specific button, a class is supposed to be added to a particular div which will then change the style of the div based on unique styles defined in my CSS file.
The original element:
<div class="Home_wordBlockWrapper__nwyZO" id="generated-block"><h3>C</h3></div>
The element after clicking the button:
<div class="Home_wordBlockWrapper__nwyZO filled rightindex" id="generated-block"><h3>C</h3></div>
CSS File:
.wordBlockWrapper {
border: 2px solid rgb(226, 232, 240);
border-radius: 5px;
width: 50px;
height: 50px;
}
.wordBlockWrapper {
justify-content: center;
align-items: center;
text-align: center;
display: flex;
transition: .5 ease-in-out;
}
.filled {
border: 2px solid black;
}
The issue I'm facing is that even though the class is successfully added, the style of the div doesn't change as expected. Can anyone help me identify where the error might be?