"Inheriting" a property from another class assigned to the same element
I want to transition background colour on an element to another colour, and then back to the original regardless of what the original colour is. If I have 2 elements (one background-color red and the other green), mousing over either of them transitions to blue, and once moused out, go back to their original colors. <div class="redSquare changeBG"></div> <div class="greenSquare changeBG"></div> <style> div { width: 200px; height: 200px; } .redSquare { background-color: red; } .greenSquare { background-color: green; } .changeBG { background-color: ???; transition: background-color 0.5s; } .chan
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.