CSS Style Question

Hello! How do I make a div with a class of “red-rectangle” a circle after I target it with a mouse? I also want to invert its color over 2-3 seconds. Here is my code:

<div class="red-rectangle">
Just a div.
</div>

Thank you!

1 Like

Hello, you may use these styles:

.red-rectangle{
transition: 2s;
}
.red-rectangle:hover{
filter: invert(100%);
border-radius: 50%;
}

Hope that helps!

2 Likes